Skip to content

Conversation

@mikeurbach
Copy link
Contributor

Historically, we have only replaced FIRRTL memories with readLatency and writeLatency of 1 with external modules for macro replacement. The latency is an intrinsic behavior of the memory, but doesn't affect its interface when we are doing external module replacement.

Since some users are trying to enable higher latency memory models, and replace them with external modules that either model this in simulation or with a macro for synthesis. This lifts the restriction, allowing such higher latency memories to also be replaced by external modules similar to memories with latency of 1.

Historically, we have only replaced FIRRTL memories with readLatency
and writeLatency of 1 with external modules for macro
replacement. The latency is an intrinsic behavior of the memory, but
doesn't affect its interface when we are doing external module
replacement.

Since some users are trying to enable higher latency memory models,
and replace them with external modules that either model this in
simulation or with a macro for synthesis. This lifts the restriction,
allowing such higher latency memories to also be replaced by external
modules similar to memories with latency of 1.
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please work with @tmckay-sifive to figure out how to define what these latencies actually mean, how they interact with different clocks, and get it into the FIRRTL spec. The real question here is I think around the conflict behavior for different read/write latencies. E.g., if the read and write latencies are both 10, then when do you have a conflict? For the full duration? At some point in the middle?

We should then make sure that for the non-repl-seq-mem path, that the in-tree memory model matches this.

Semi-related: fixing this in the background would be good: #787

One actual review question: are these latencies recorded in the resulting repl-seq-mem JSON format?

// CHECK-NOT: infer_mux_override

// COM: Check repl-seq-mem for readLatency = 0, writeLatency = 1
// REPL-SEQ-MEM-NOT: hw.module.extern @FIRRTLMem_1_1_1_16_1_0_1_0_0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly just REPL-SEQ-MEM-NOT: hw.module.extern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants