fpga_interchange: tests: add techmap optional source file
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
parent
3f3cabea2d
commit
f52b5b39ed
@ -8,6 +8,7 @@ function(add_interchange_test)
|
|||||||
# xdc <xdc>
|
# xdc <xdc>
|
||||||
# top <top name>
|
# top <top name>
|
||||||
# sources <sources list>
|
# sources <sources list>
|
||||||
|
# [techmap <techmap file>]
|
||||||
# )
|
# )
|
||||||
#
|
#
|
||||||
# Generates targets to run desired tests
|
# Generates targets to run desired tests
|
||||||
@ -16,10 +17,10 @@ function(add_interchange_test)
|
|||||||
# - test-fpga_interchange-<name>-json : synthesis output
|
# - test-fpga_interchange-<name>-json : synthesis output
|
||||||
# - test-fpga_interchange-<name>-netlist : interchange logical netlist
|
# - test-fpga_interchange-<name>-netlist : interchange logical netlist
|
||||||
# - test-fpga_interchange-<name>-phys : interchange physical netlist
|
# - test-fpga_interchange-<name>-phys : interchange physical netlist
|
||||||
# - test-fpga_interchange-<name>-phys : design checkpoint with RapidWright
|
# - test-fpga_interchange-<name>-dcp : design checkpoint with RapidWright
|
||||||
|
|
||||||
set(options)
|
set(options)
|
||||||
set(oneValueArgs name device package tcl xdc top)
|
set(oneValueArgs name device package tcl xdc top techmap)
|
||||||
set(multiValueArgs sources)
|
set(multiValueArgs sources)
|
||||||
|
|
||||||
cmake_parse_arguments(
|
cmake_parse_arguments(
|
||||||
@ -36,6 +37,7 @@ function(add_interchange_test)
|
|||||||
set(top ${add_interchange_test_top})
|
set(top ${add_interchange_test_top})
|
||||||
set(tcl ${CMAKE_CURRENT_SOURCE_DIR}/${add_interchange_test_tcl})
|
set(tcl ${CMAKE_CURRENT_SOURCE_DIR}/${add_interchange_test_tcl})
|
||||||
set(xdc ${CMAKE_CURRENT_SOURCE_DIR}/${add_interchange_test_xdc})
|
set(xdc ${CMAKE_CURRENT_SOURCE_DIR}/${add_interchange_test_xdc})
|
||||||
|
set(techmap ${CMAKE_CURRENT_SOURCE_DIR}/${add_interchange_test_techmap})
|
||||||
|
|
||||||
set(sources)
|
set(sources)
|
||||||
foreach(source ${add_interchange_test_sources})
|
foreach(source ${add_interchange_test_sources})
|
||||||
@ -54,6 +56,7 @@ function(add_interchange_test)
|
|||||||
COMMAND
|
COMMAND
|
||||||
SOURCES=${sources}
|
SOURCES=${sources}
|
||||||
OUT_JSON=${synth_json}
|
OUT_JSON=${synth_json}
|
||||||
|
TECHMAP=${techmap}
|
||||||
yosys -c ${tcl}
|
yosys -c ${tcl}
|
||||||
DEPENDS ${sources}
|
DEPENDS ${sources}
|
||||||
)
|
)
|
||||||
|
@ -5,6 +5,7 @@ add_interchange_test(
|
|||||||
tcl run.tcl
|
tcl run.tcl
|
||||||
xdc counter_basys3.xdc
|
xdc counter_basys3.xdc
|
||||||
sources counter.v
|
sources counter.v
|
||||||
|
techmap remap.v
|
||||||
)
|
)
|
||||||
|
|
||||||
add_interchange_test(
|
add_interchange_test(
|
||||||
@ -14,4 +15,5 @@ add_interchange_test(
|
|||||||
tcl run.tcl
|
tcl run.tcl
|
||||||
xdc counter_arty.xdc
|
xdc counter_arty.xdc
|
||||||
sources counter.v
|
sources counter.v
|
||||||
|
techmap remap.v
|
||||||
)
|
)
|
||||||
|
11
fpga_interchange/examples/tests/counter/remap.v
Normal file
11
fpga_interchange/examples/tests/counter/remap.v
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module INV(input I, output O);
|
||||||
|
|
||||||
|
LUT1 #(.INIT(2'b01)) _TECHMAP_REPLACE_ (.I0(I), .O(O));
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
module BUF(input I, output O);
|
||||||
|
|
||||||
|
LUT1 #(.INIT(2'b10)) _TECHMAP_REPLACE_ (.I0(I), .O(O));
|
||||||
|
|
||||||
|
endmodule
|
@ -3,7 +3,7 @@ yosys -import
|
|||||||
read_verilog $::env(SOURCES)
|
read_verilog $::env(SOURCES)
|
||||||
|
|
||||||
synth_xilinx -nolutram -nowidelut -nosrl -nocarry -nodsp
|
synth_xilinx -nolutram -nowidelut -nosrl -nocarry -nodsp
|
||||||
techmap -map ../remap.v
|
techmap -map $::env(TECHMAP)
|
||||||
|
|
||||||
# opt_expr -undriven makes sure all nets are driven, if only by the $undef
|
# opt_expr -undriven makes sure all nets are driven, if only by the $undef
|
||||||
# net.
|
# net.
|
||||||
|
Loading…
Reference in New Issue
Block a user