[test] add a new test to validate reset generated by internal driver through programmable clock network
This commit is contained in:
parent
213914e4ac
commit
af996e563e
|
@ -0,0 +1,26 @@
|
|||
/////////////////////////////////////////
|
||||
// Functionality: A locally generated reset signal which is to test clock network with internal drivers
|
||||
// Author: Xifan Tang
|
||||
////////////////////////////////////////
|
||||
`timescale 1ns / 1ps
|
||||
|
||||
module clk_cond(rst_i, rst_cond_i, clk_i, d_i, q_o);
|
||||
|
||||
input wire rst_cond_i;
|
||||
input wire rst_i;
|
||||
input wire clk_i;
|
||||
input wire d_i;
|
||||
output reg q_o;
|
||||
|
||||
wire int_rst;
|
||||
assign int_rst = rst_cond_i & rst_i;
|
||||
|
||||
always @(posedge int_rst or posedge clk_i) begin
|
||||
if (int_rst) begin
|
||||
q_o <= 0;
|
||||
end else begin
|
||||
q_o <= d_i;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
|
@ -0,0 +1,36 @@
|
|||
<clock_networks default_segment="L1" default_tap_switch="ipin_cblock" default_driver_switch="0">
|
||||
<clock_network name="clk_tree_2lvl" global_port="op_clk[0:0]">
|
||||
<spine name="clk_spine_lvl0" start_x="1" start_y="1" end_x="2" end_y="1">
|
||||
<switch_point tap="clk_rib_lvl1_sw0_upper" x="1" y="1"/>
|
||||
<switch_point tap="clk_rib_lvl1_sw0_lower" x="1" y="1"/>
|
||||
<switch_point tap="clk_rib_lvl1_sw1_upper" x="2" y="1"/>
|
||||
<switch_point tap="clk_rib_lvl1_sw1_lower" x="2" y="1"/>
|
||||
</spine>
|
||||
<spine name="clk_rib_lvl1_sw0_upper" start_x="1" start_y="2" end_x="1" end_y="2" type="CHANY" direction="INC_DIRECTION"/>
|
||||
<spine name="clk_rib_lvl1_sw0_lower" start_x="1" start_y="1" end_x="1" end_y="1" type="CHANY" direction="DEC_DIRECTION"/>
|
||||
<spine name="clk_rib_lvl1_sw1_upper" start_x="2" start_y="2" end_x="2" end_y="2" type="CHANY" direction="INC_DIRECTION"/>
|
||||
<spine name="clk_rib_lvl1_sw1_lower" start_x="2" start_y="1" end_x="2" end_y="1" type="CHANY" direction="DEC_DIRECTION"/>
|
||||
<taps>
|
||||
<all from_pin="op_clk[0:0]" to_pin="clb[0:0].clk[0:0]"/>
|
||||
</taps>
|
||||
</clock_network>
|
||||
<clock_network name="rst_tree_2lvl" global_port="op_reset[0:0]">
|
||||
<spine name="rst_spine_lvl0" start_x="1" start_y="1" end_x="2" end_y="1">
|
||||
<switch_point tap="rst_rib_lvl1_sw0_upper" x="1" y="1">
|
||||
<internal_driver tile_pin="clb.O[0:7]"/>
|
||||
</switch_point>
|
||||
<switch_point tap="rst_rib_lvl1_sw0_lower" x="1" y="1">
|
||||
<internal_driver tile_pin="clb.O[0:7]"/>
|
||||
</switch_point>
|
||||
<switch_point tap="rst_rib_lvl1_sw1_upper" x="2" y="1"/>
|
||||
<switch_point tap="rst_rib_lvl1_sw1_lower" x="2" y="1"/>
|
||||
</spine>
|
||||
<spine name="rst_rib_lvl1_sw0_upper" start_x="1" start_y="2" end_x="1" end_y="2" type="CHANY" direction="INC_DIRECTION"/>
|
||||
<spine name="rst_rib_lvl1_sw0_lower" start_x="1" start_y="1" end_x="1" end_y="1" type="CHANY" direction="DEC_DIRECTION"/>
|
||||
<spine name="rst_rib_lvl1_sw1_upper" start_x="2" start_y="2" end_x="2" end_y="2" type="CHANY" direction="INC_DIRECTION"/>
|
||||
<spine name="rst_rib_lvl1_sw1_lower" start_x="2" start_y="1" end_x="2" end_y="1" type="CHANY" direction="DEC_DIRECTION"/>
|
||||
<taps>
|
||||
<all from_pin="op_reset[0:0]" to_pin="clb[0:0].reset[0:0]"/>
|
||||
</taps>
|
||||
</clock_network>
|
||||
</clock_networks>
|
|
@ -0,0 +1,8 @@
|
|||
<pin_constraints>
|
||||
<!-- For a given .blif file, we want to assign
|
||||
- the reset signal to the op_reset[0] port of the FPGA fabric
|
||||
-->
|
||||
<set_io pin="op_reset[0]" net="int_rst"/>
|
||||
<set_io pin="op_clk[0]" net="clk_i"/>
|
||||
</pin_constraints>
|
||||
|
|
@ -32,6 +32,7 @@ arch0=${PATH:OPENFPGA_PATH}/openfpga_flow/vpr_arch/k4_frac_N4_tileable_fracff_40
|
|||
|
||||
[BENCHMARKS]
|
||||
bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/clk_cond/clk_cond.v
|
||||
bench0=${PATH:OPENFPGA_PATH}/openfpga_flow/benchmarks/micro_benchmark/rst_cond/rst_cond.v
|
||||
|
||||
[SYNTHESIS_PARAM]
|
||||
# Yosys script parameters
|
||||
|
@ -44,6 +45,12 @@ bench_yosys_rewrite_common=${PATH:OPENFPGA_PATH}/openfpga_flow/misc/ys_tmpl_yosy
|
|||
bench0_top = clk_cond
|
||||
bench0_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints_clk_cond.xml
|
||||
bench0_openfpga_vpr_constraint_file=${PATH:TASK_DIR}/config/vpr_constraint_clk_cond.xml
|
||||
bench0_openfpga_clock_arch_file=${PATH:TASK_DIR}/config/clk_arch_1clk_1rst_2layer_int_driver_clk.xml
|
||||
|
||||
bench1_top = rst_cond
|
||||
bench1_openfpga_pin_constraints_file = ${PATH:TASK_DIR}/config/pin_constraints_rst_cond.xml
|
||||
bench1_openfpga_vpr_constraint_file=${PATH:TASK_DIR}/config/vpr_constraint_rst_cond.xml
|
||||
bench1_openfpga_clock_arch_file=${PATH:TASK_DIR}/config/clk_arch_1clk_1rst_2layer_int_driver_rst.xml
|
||||
|
||||
[SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH]
|
||||
end_flow_with_test=
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<vpr_constraints tool_name="vpr">
|
||||
<partition_list>
|
||||
<partition name="q_o_part">
|
||||
<add_atom name_pattern="q_o"/>
|
||||
<add_region x_low="1" y_low="2" x_high="1" y_high="2"/>
|
||||
</partition>
|
||||
<partition name="int_rst_part">
|
||||
<add_atom name_pattern="int_rst*"/>
|
||||
<add_region x_low="1" y_low="1" x_high="1" y_high="1"/>
|
||||
</partition>
|
||||
</partition_list>
|
||||
</vpr_constraints>
|
Loading…
Reference in New Issue