mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
Added $meminit cell type
This commit is contained in:
parent
ef151b0b30
commit
910556560f
|
@ -135,6 +135,7 @@ struct CellTypes
|
||||||
|
|
||||||
setup_type("$memrd", {CLK, ADDR}, {DATA});
|
setup_type("$memrd", {CLK, ADDR}, {DATA});
|
||||||
setup_type("$memwr", {CLK, EN, ADDR, DATA}, pool<RTLIL::IdString>());
|
setup_type("$memwr", {CLK, EN, ADDR, DATA}, pool<RTLIL::IdString>());
|
||||||
|
setup_type("$meminit", {ADDR, DATA}, pool<RTLIL::IdString>());
|
||||||
setup_type("$mem", {RD_CLK, RD_ADDR, WR_CLK, WR_EN, WR_ADDR, WR_DATA}, {RD_DATA});
|
setup_type("$mem", {RD_CLK, RD_ADDR, WR_CLK, WR_EN, WR_ADDR, WR_DATA}, {RD_DATA});
|
||||||
|
|
||||||
setup_type("$fsm", {CLK, ARST, CTRL_IN}, {CTRL_OUT});
|
setup_type("$fsm", {CLK, ARST, CTRL_IN}, {CTRL_OUT});
|
||||||
|
|
|
@ -904,6 +904,15 @@ namespace {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cell->type == "$meminit") {
|
||||||
|
param("\\MEMID");
|
||||||
|
param("\\PRIORITY");
|
||||||
|
port("\\ADDR", param("\\ABITS"));
|
||||||
|
port("\\DATA", param("\\WIDTH"));
|
||||||
|
check_expected();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (cell->type == "$mem") {
|
if (cell->type == "$mem") {
|
||||||
param("\\MEMID");
|
param("\\MEMID");
|
||||||
param("\\SIZE");
|
param("\\SIZE");
|
||||||
|
|
|
@ -47,7 +47,7 @@ void rmunused_module_cells(Module *module, bool verbose)
|
||||||
if (bit.wire != nullptr)
|
if (bit.wire != nullptr)
|
||||||
wire2driver[bit].insert(cell);
|
wire2driver[bit].insert(cell);
|
||||||
}
|
}
|
||||||
if (cell->type == "$memwr" || cell->type == "$assert" || cell->has_keep_attr())
|
if (cell->type.in("$memwr", "$meminit", "$assert") || cell->has_keep_attr())
|
||||||
queue.insert(cell);
|
queue.insert(cell);
|
||||||
else
|
else
|
||||||
unused.insert(cell);
|
unused.insert(cell);
|
||||||
|
|
|
@ -1514,6 +1514,28 @@ endmodule
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
|
||||||
|
module \$meminit (ADDR, DATA);
|
||||||
|
|
||||||
|
parameter MEMID = "";
|
||||||
|
parameter ABITS = 8;
|
||||||
|
parameter WIDTH = 8;
|
||||||
|
|
||||||
|
parameter PRIORITY = 0;
|
||||||
|
|
||||||
|
input [ABITS-1:0] ADDR;
|
||||||
|
input [WIDTH-1:0] DATA;
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
if (MEMID != "") begin
|
||||||
|
$display("ERROR: Found non-simulatable instance of $meminit!");
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
|
||||||
module \$mem (RD_CLK, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA);
|
module \$mem (RD_CLK, RD_ADDR, RD_DATA, WR_CLK, WR_EN, WR_ADDR, WR_DATA);
|
||||||
|
|
||||||
parameter MEMID = "";
|
parameter MEMID = "";
|
||||||
|
|
Loading…
Reference in a new issue