mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-18 20:03:39 +00:00
Correct and more test
This commit is contained in:
parent
a0dabf9203
commit
414dc85573
2 changed files with 24 additions and 1 deletions
|
@ -77,6 +77,6 @@ struct ConstmapPass : public Pass {
|
||||||
module->rewrite_sigspecs(constmap_worker);
|
module->rewrite_sigspecs(constmap_worker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} HilomapPass;
|
} ConstmapPass;
|
||||||
|
|
||||||
PRIVATE_NAMESPACE_END
|
PRIVATE_NAMESPACE_END
|
||||||
|
|
|
@ -16,6 +16,7 @@ design -reset
|
||||||
|
|
||||||
read_verilog -lib << EOT
|
read_verilog -lib << EOT
|
||||||
module const_cell(O);
|
module const_cell(O);
|
||||||
|
parameter value=0;
|
||||||
output O;
|
output O;
|
||||||
endmodule
|
endmodule
|
||||||
EOT
|
EOT
|
||||||
|
@ -33,8 +34,30 @@ endmodule
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
constmap -cell const_cell O value
|
constmap -cell const_cell O value
|
||||||
|
|
||||||
select -assert-count 2 t:const_cell
|
select -assert-count 2 t:const_cell
|
||||||
select -assert-count 1 r:value=16
|
select -assert-count 1 r:value=16
|
||||||
select -assert-count 1 r:value=32
|
select -assert-count 1 r:value=32
|
||||||
select -assert-count 1 test/out1 %ci* r:value=16 %i
|
select -assert-count 1 test/out1 %ci* r:value=16 %i
|
||||||
select -assert-count 1 test/out2 %ci* r:value=32 %i
|
select -assert-count 1 test/out2 %ci* r:value=32 %i
|
||||||
|
select -assert-count 1 t:const_cell r:value=16 %i
|
||||||
|
select -assert-count 1 t:const_cell r:value=32 %i
|
||||||
|
|
||||||
|
design -reset
|
||||||
|
|
||||||
|
read_verilog << EOT
|
||||||
|
|
||||||
|
module test();
|
||||||
|
wire [31:0] in;
|
||||||
|
wire [31:0] out1;
|
||||||
|
wire [31:0] out2;
|
||||||
|
assign out1 = in + 16;
|
||||||
|
assign out2 = in + 32;
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
EOT
|
||||||
|
|
||||||
|
constmap -cell const_cell O value
|
||||||
|
|
||||||
|
select -assert-count 1 t:const_cell r:value=16 %i
|
||||||
|
select -assert-count 1 t:const_cell r:value=32 %i
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue