Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENABLE_CUSTOM_FIRRTL_PASS changes inferred SRAMs #1385

Open
3 tasks done
tymcauley opened this issue Mar 8, 2023 · 0 comments
Open
3 tasks done

ENABLE_CUSTOM_FIRRTL_PASS changes inferred SRAMs #1385

tymcauley opened this issue Mar 8, 2023 · 0 comments
Labels

Comments

@tymcauley
Copy link
Contributor

tymcauley commented Mar 8, 2023

Background Work

Chipyard Version and Hash

Release: main
Hash: 4f74f29

OS Setup

macOS 13.2.1

Other Setup

Check out fresh Chipyard, run ./scripts/init-submodules-no-riscv-tools.sh

Current Behavior

If you build the default RocketConfig with and without ENABLE_CUSTOM_FIRRTL_PASS=1, you will get different RTL at the end. I haven't exhaustively checked the differences, but I can see that when ENABLE_CUSTOM_FIRRTL_PASS=1, the SRAMs in top.mems.conf are much narrower.

To reproduce:

$ make -C sims/vcs ENABLE_CUSTOM_FIRRTL_PASS=1 verilog
...
$ mv sims/vcs/generated-src sims/vcs/generated-src.custom-firrtl-pass-enabled/
$ make -C sims/vcs verilog
...
$ cat sims/vcs/generated-src/chipyard.TestHarness.RocketConfig/chipyard.TestHarness.RocketConfig.top.mems.conf
name cc_dir_ext depth 1024 width 136 ports mrw mask_gran 17
name cc_banks_0_ext depth 16384 width 64 ports rw
name data_arrays_0_ext depth 512 width 256 ports mrw mask_gran 8
name tag_array_ext depth 64 width 88 ports mrw mask_gran 22
name tag_array_0_ext depth 64 width 84 ports mrw mask_gran 21
name data_arrays_0_0_ext depth 512 width 128 ports mrw mask_gran 32
$ cat sims/vcs/generated-src.custom-firrtl-pass-enabled/chipyard.TestHarness.RocketConfig/chipyard.TestHarness.RocketConfig.top.mems.conf
name cc_dir_0_ext depth 1024 width 17 ports mrw mask_gran 17
name cc_banks_0_ext depth 16384 width 64 ports rw
name data_arrays_0_0_ext depth 512 width 8 ports mrw mask_gran 8
name tag_array_0_ext depth 64 width 22 ports mrw mask_gran 22
name tag_array_0_0_ext depth 64 width 21 ports mrw mask_gran 21
name data_arrays_0_0_0_ext depth 512 width 32 ports mrw mask_gran 32

You can see that each SRAM is much narrower (the width field is smaller) for the design where ENABLE_CUSTOM_FIRRTL_PASS=1. It looks like the design instantiates several parallel instances of each SRAM to make up the same design as when ENABLE_CUSTOM_FIRRTL_PASS is unset.

I'm not sure if the two designs are functionally identical, but even if they are, using narrower SRAMs could be a problem if users were hoping to use particular foundry SRAMs with wider entries.

Expected Behavior

I would expect the ENABLE_CUSTOM_FIRRTL_PASS=1 build to produce the same Verilog for the RocketConfig as when ENABLE_CUSTOM_FIRRTL_PASS is unset.

Other Information

I think this is the same issue as noted here: #1239 (comment)

@tymcauley tymcauley added the bug label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant