You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The memory randomization logic for FIRRTL memories is being included. However, the required Verilog macros are not being included. This can create situations where memories are not initialized.
This includes randomization logic, but it will never run unless other macros are defined. To highlight this, see all the macros generated for module Foo:
// Generated by CIRCT firtool-1.101.0-44-g0cea50e9e// Include rmemory initializers in init blocks unless synthesis is set
`ifndef RANDOMIZE
`ifdef RANDOMIZE_MEM_INIT
`define RANDOMIZE
`endif// RANDOMIZE_MEM_INIT`endif// not def RANDOMIZE
`ifndef SYNTHESIS
`ifndef ENABLE_INITIAL_MEM_
`define ENABLE_INITIAL_MEM_
`endif// not def ENABLE_INITIAL_MEM_`endif// not def SYNTHESIS// Standard header to adapt well known macros for register randomization.// RANDOM may be set to an expression that produces a 32-bit random unsigned value.
`ifndef RANDOM
`define RANDOM $random`endif// not def RANDOM// Users can define INIT_RANDOM as general code that gets injected into the// initializer block for modules with registers.
`ifndef INIT_RANDOM
`define INIT_RANDOM
`endif// not def INIT_RANDOM// If using random initialization, you can also define RANDOMIZE_DELAY to// customize the delay used, otherwise 0.002 is used.
`ifndef RANDOMIZE_DELAY
`define RANDOMIZE_DELAY 0.002`endif// not def RANDOMIZE_DELAY// Define INIT_RANDOM_PROLOG_ for use in our modules below.
`ifndef INIT_RANDOM_PROLOG_
`ifdef RANDOMIZE
`ifdef VERILATOR
`define INIT_RANDOM_PROLOG_ `INIT_RANDOM
`else// VERILATOR `define INIT_RANDOM_PROLOG_ `INIT_RANDOM #`RANDOMIZE_DELAY beginend `endif// VERILATOR `else// RANDOMIZE `define INIT_RANDOM_PROLOG_
`endif// RANDOMIZE`endif// not def INIT_RANDOM_PROLOG_moduleFoo(
input clock,
input [2:0] r_addr,
input r_en,
output [31:0] r_data,
input [2:0] w_addr,
input w_en,
input [31:0] w_data,
inputw_mask
);
memory_16x32memory_ext (
.R0_addr ({1'h0, r_addr}),
.R0_en (r_en),
.R0_clk (clock),
.R0_data (r_data),
.W0_addr ({1'h0, w_addr}),
.W0_en (w_en & w_mask),
.W0_clk (clock),
.W0_data (w_data)
);
endmodule
Fix this by generating the macros for the memory.
The text was updated successfully, but these errors were encountered:
When generating modules as part of the SeqToSV conversion, put appropriate
memory generation fragments onto the created `hw.module.generated`. No
longer put memory randomization fragments onto the original module.
Fixes#8164.
Signed-off-by: Schuyler Eldridge <[email protected]>
When generating modules as part of the SeqToSV conversion, put appropriate
memory generation fragments onto the created `hw.module.generated`. No
longer put memory randomization fragments onto the original module.
Fixes#8164.
Signed-off-by: Schuyler Eldridge <[email protected]>
The memory randomization logic for FIRRTL memories is being included. However, the required Verilog macros are not being included. This can create situations where memories are not initialized.
Consider the following FIRRTL:
When compiled, this produces (with split-verilog to make it more obvious) the following memory:
This includes randomization logic, but it will never run unless other macros are defined. To highlight this, see all the macros generated for module
Foo
:Fix this by generating the macros for the memory.
The text was updated successfully, but these errors were encountered: