Can I have SyncReadMem() and firtool output a file with a single clock?

68 views
Skip to first unread message

Øyvind Harboe

unread,
Oct 7, 2023, 1:05:05 PM10/7/23
to chisel-users
I am getting one clock per read and write port, even if there is a single clock in my design where SyncReadMem() is invoked.

Is there a way to tell SyncReadMem() to generate a .sv file for this SRAM with a single clock?


module registers_32x64(
input [4:0] R0_addr,
input R0_en,
R0_clk,

input [4:0] W0_addr,
input W0_en,
W0_clk,
input [63:0] W0_data,
input [7:0] W0_mask,
input [4:0] W1_addr,
input W1_en,
W1_clk,

Schuyler Eldridge

unread,
Oct 9, 2023, 2:50:25 PM10/9/23
to chisel...@googlegroups.com
There is currently no way to do this. Keeping this as-is, where you get a memory (or a blackbox module) with this predictable lowering has ABI benefits---you know what you're going to get and it's not a function of whether two clocks are wired together trivially or, as some might expect, in a more complicated way somewhere earlier in the hierarchy.

Chisel or FIRRTL don't have the ideal representation for clocks and resets as these are closer to "global resources" rather than things which are ports and can be put into wires or registers. Reworking Chisel in this direction would help with the desired emission strategy as there is then an unambiguous way to say that two ports of a memory have _the same clock_ as opposed to _the same wire_.

tl;dr: Wiring the ports together is the right way to proceed or to put the memory in a wrapper module in Chisel.

--
You received this message because you are subscribed to the Google Groups "chisel-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/1f1f2ed1-4c79-46a7-ad0b-17906f028b16n%40googlegroups.com.

Øyvind Harboe

unread,
Oct 16, 2023, 9:37:05 AM10/16/23
to chisel-users
I'm tinkering with OpenROAD flow scripts and MegaBoom.

There are ca. 100 SRAMs in MegaBoom and each of these SRAMs have various read and write ports, so that's *at least* different 200 clock names... If they were *all* called "clock", then things would be a LOT simpler w.r.t. setting up the backend scripts, such as the .sdc file...
Reply all
Reply to author
Forward
0 new messages