mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
fabulous: Allow adding extra custom prims and map rules
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
f111bbdf40
commit
b6467f0801
4 changed files with 53 additions and 0 deletions
3
tests/arch/fabulous/custom_map.v
Normal file
3
tests/arch/fabulous/custom_map.v
Normal file
|
@ -0,0 +1,3 @@
|
|||
module AND(input [7:0] A, B, output [7:0] Y);
|
||||
ALU #(.MODE("AND")) _TECHMAP_REPLACE_ (.A(A), .B(B), .Y(Y));
|
||||
endmodule
|
8
tests/arch/fabulous/custom_prims.v
Normal file
8
tests/arch/fabulous/custom_prims.v
Normal file
|
@ -0,0 +1,8 @@
|
|||
(* blackbox *)
|
||||
module AND(input [7:0] A, B, output [7:0] Y);
|
||||
endmodule
|
||||
|
||||
(* blackbox *)
|
||||
module ALU(input [7:0] A, B, output [7:0] Y);
|
||||
parameter MODE = "";
|
||||
endmodule
|
10
tests/arch/fabulous/customisation.ys
Normal file
10
tests/arch/fabulous/customisation.ys
Normal file
|
@ -0,0 +1,10 @@
|
|||
read_verilog <<EOT
|
||||
module prim_test(input [7:0] a, b, output [7:0] q);
|
||||
AND and_i (.A(a), .B(b), .Y(q));
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
# Test adding custom primitives and techmap rules
|
||||
synth_fabulous -top prim_test -extra-plib custom_prims.v -extra-map custom_map.v
|
||||
cd prim_test
|
||||
select -assert-count 1 t:ALU
|
Loading…
Add table
Add a link
Reference in a new issue