Skip to content

Commit f946c05

Browse files
committed
added zybo
1 parent 72cfac3 commit f946c05

File tree

9 files changed

+194
-5
lines changed

9 files changed

+194
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
tmp
33
xilinx/scripts/add_sources.artyz720.tcl
44
xilinx/scripts/add_sources.genesys2.tcl
5+
xilinx/scripts/add_sources.zyboz720.tcl

Bender.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ sources:
7272
files:
7373
- xilinx/hw/croc_xilinx.sv
7474

75+
- target: zyboz720
76+
files:
77+
- xilinx/hw/croc_xilinx.sv
78+
7579
vendor_package:
7680
#################################
7781
# commonly used building blocks #

xilinx/hw/croc_xilinx.sv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
`define USE_VIO
3131
`endif
3232

33+
`ifdef TARGET_ZYBOZ720
34+
`define USE_RESET
35+
`define USE_STATUS
36+
`define USE_SWITCHES
37+
`define USE_LEDS
38+
`define USE_VIO
39+
`endif
40+
3341

3442
`define ila(__name, __signal) \
3543
(* dont_touch = "yes" *) (* mark_debug = "true" *) logic [$bits(__signal)-1:0] __name; \

xilinx/implement.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ while getopts "b:" opt; do
1111
;;
1212
\? )
1313
echo "Usage: $0 [-b board_type]"
14-
echo "Supported boards: genesys2, artyz720"
14+
echo "Supported boards: genesys2, artyz720, zyboz720"
1515
exit 1
1616
;;
1717
esac
1818
done
1919

2020
# Validate board selection
21-
if [[ "$BOARD" != "genesys2" && "$BOARD" != "artyz720" ]]; then
21+
if [[ "$BOARD" != "genesys2" && "$BOARD" != "artyz720" && "$BOARD" != "zyboz720" ]]; then
2222
echo "Error: Unsupported board type '$BOARD'"
23-
echo "Supported boards: genesys2, artyz720"
23+
echo "Supported boards: genesys2, artyz720, zyboz720"
2424
exit 1
2525
fi
2626

xilinx/scripts/clkwiz/clkwiz_artyz720.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Florian Zaruba <zarubaf@iis.ee.ethz.ch>
66
# Cyril Koenig <cykoenig@iis.ee.ethz.ch>
77
# Paul Scheffler <paulsc@iis.ee.ethz.ch>
8+
# Felix Niederer <fniederer@student.ethz.ch>
89

910
create_ip -name clk_wiz -vendor xilinx.com -library ip -version 6.0 -module_name $proj
1011
set_property -dict [list \

xilinx/scripts/clkwiz/clkwiz_genesys2.tcl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# Florian Zaruba <zarubaf@iis.ee.ethz.ch>
66
# Cyril Koenig <cykoenig@iis.ee.ethz.ch>
77
# Paul Scheffler <paulsc@iis.ee.ethz.ch>
8-
# Felix Niederer <fniederer@student.ethz.ch>
9-
108

119
create_ip -name clk_wiz -vendor xilinx.com -library ip -version 6.0 -module_name $proj
1210
set_property -dict [list \
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2024 ETH Zurich and University of Bologna.
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: SHL-0.51
4+
#
5+
# Florian Zaruba <zarubaf@iis.ee.ethz.ch>
6+
# Cyril Koenig <cykoenig@iis.ee.ethz.ch>
7+
# Paul Scheffler <paulsc@iis.ee.ethz.ch>
8+
# Felix Niederer <fniederer@student.ethz.ch>
9+
10+
create_ip -name clk_wiz -vendor xilinx.com -library ip -version 6.0 -module_name $proj
11+
set_property -dict [list \
12+
CONFIG.PRIM_SOURCE {No_buffer} \
13+
CONFIG.PRIM_IN_FREQ {125.000} \
14+
CONFIG.CLKOUT1_USED {true} \
15+
CONFIG.CLK_OUT1_PORT {clk_20} \
16+
CONFIG.CLKOUT1_REQUESTED_OUT_FREQ {20.000} \
17+
CONFIG.CLKIN1_JITTER_PS {50.0} \
18+
CONFIG.MMCM_CLKFBOUT_MULT_F {8.000} \
19+
CONFIG.MMCM_CLKIN1_PERIOD {8.000} \
20+
CONFIG.MMCM_CLKOUT1_DIVIDE {50} \
21+
CONFIG.NUM_OUT_CLKS {1} \
22+
CONFIG.CLKOUT1_JITTER {155.330} \
23+
CONFIG.CLKOUT1_PHASE_ERROR {89.971} \
24+
] [get_ips $proj]

xilinx/scripts/common.tcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ set bpart(artyz720) "digilentinc.com:arty-z7-20:part0:1.1"
1414
set fpart(artyz720) "xc7z020clg400-1"
1515
set hwdev(artyz720) "xc7z020c"
1616

17+
# zyboz720 board params
18+
set bpart(zyboz720) "digilentinc.com:zybo-z7-20:part0:1.2"
19+
set fpart(zyboz720) "xc7z020clg400-1"
20+
set hwdev(zyboz720) "xc7z020c"
21+
1722
# vcu128 board params
1823
set bpart(vcu128) "xilinx.com:vcu128:part0:1.0"
1924
set fpart(vcu128) "xcvu37p-fsvh2892-2L-e"

xilinx/src/zyboz720.xdc

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# --------------------------------------------------------------------------------------------------
2+
# Constraint File for the Zybo-Z7 20 Board
3+
# --------------------------------------------------------------------------------------------------
4+
5+
# --------------------------------------------------------------------------------------------------
6+
# Clock Source
7+
# --------------------------------------------------------------------------------------------------
8+
set_property -dict { PACKAGE_PIN K17 IOSTANDARD LVCMOS33 } [get_ports { sys_clk_p }]; #IO_L12P_T1_MRCC_35 Sch=sysclk
9+
create_clock -add -name sys_clk -period 8.00 -waveform {0 4} [get_ports { sys_clk_p }];
10+
11+
12+
# SoC clock is generated by clock wizard and its constraints
13+
set SOC_TCK 50.0
14+
set soc_clk [get_clocks -of_objects [get_pins i_clkwiz/clk_20]]
15+
16+
# --------------------------------------------------------------------------------------------------
17+
# Switches
18+
# --------------------------------------------------------------------------------------------------
19+
set_property -dict { PACKAGE_PIN G15 IOSTANDARD LVCMOS33 } [get_ports { fetch_en_i }]; #IO_L19N_T3_VREF_35 Sch=sw[0]
20+
set_property -dict { PACKAGE_PIN P15 IOSTANDARD LVCMOS33 } [get_ports { gpio_i[0] }]; #IO_L24P_T3_34 Sch=sw[1]
21+
set_property -dict { PACKAGE_PIN W13 IOSTANDARD LVCMOS33 } [get_ports { gpio_i[1] }]; #IO_L4N_T0_34 Sch=sw[2]
22+
set_property -dict { PACKAGE_PIN T16 IOSTANDARD LVCMOS33 } [get_ports { gpio_i[2] }]; #IO_L9P_T1_DQS_34 Sch=sw[3]
23+
24+
# set_false_path -from [get_ports {fetch_en_i}] -to *
25+
# set_input_delay -clock sys_clk 0.0 [get_ports {fetch_en_i}]
26+
27+
set_false_path -from [get_ports {gpio_i*}] -to *
28+
set_input_delay -clock sys_clk 0.0 [get_ports {gpio_i*}]
29+
30+
# --------------------------------------------------------------------------------------------------
31+
# Buttons
32+
# --------------------------------------------------------------------------------------------------
33+
set_property -dict { PACKAGE_PIN K18 IOSTANDARD LVCMOS33 } [get_ports { sys_reset }]; #IO_L12N_T1_MRCC_35 Sch=btn[0]
34+
set_property -dict { PACKAGE_PIN P16 IOSTANDARD LVCMOS33 } [get_ports { gpio_i[3] }]; #IO_L24N_T3_34 Sch=btn[1]
35+
36+
37+
# --------------------------------------------------------------------------------------------------
38+
# LEDs
39+
# --------------------------------------------------------------------------------------------------
40+
set_property -dict { PACKAGE_PIN M14 IOSTANDARD LVCMOS33 } [get_ports { status_o }]; #IO_L23P_T3_35 Sch=led[0]
41+
set_property -dict { PACKAGE_PIN M15 IOSTANDARD LVCMOS33 } [get_ports { gpio_o[0] }]; #IO_L23N_T3_35 Sch=led[1]
42+
set_property -dict { PACKAGE_PIN G14 IOSTANDARD LVCMOS33 } [get_ports { gpio_o[1] }]; #IO_0_35 Sch=led[2]
43+
set_property -dict { PACKAGE_PIN D18 IOSTANDARD LVCMOS33 } [get_ports { gpio_o[2] }]; #IO_L3N_T0_DQS_AD1N_35 Sch=led[3]
44+
set_property -dict { PACKAGE_PIN F17 IOSTANDARD LVCMOS33 } [get_ports { gpio_o[3] }]; #IO_L6N_T0_VREF_35 Sch=led6_g
45+
46+
set_false_path -from * -to [get_ports {status_o}]
47+
set_output_delay -clock sys_clk 0.0 [get_ports {status_o}]
48+
49+
set_false_path -from * -to [get_ports {gpio_o*}]
50+
set_output_delay -clock sys_clk 0.0 [get_ports {gpio_o*}]
51+
52+
53+
54+
# --------------------------------------------------------------------------------------------------
55+
# Pmod Header JB (Zybo Z7-20 only)
56+
# --------------------------------------------------------------------------------------------------
57+
set_property -dict { PACKAGE_PIN V8 IOSTANDARD LVCMOS33 } [get_ports { jtag_tms_i }]; #IO_L15P_T2_DQS_13 Sch=jb_p[1]
58+
set_property -dict { PACKAGE_PIN W8 IOSTANDARD LVCMOS33 } [get_ports { jtag_tdi_i }]; #IO_L15N_T2_DQS_13 Sch=jb_n[1]
59+
set_property -dict { PACKAGE_PIN U7 IOSTANDARD LVCMOS33 } [get_ports { jtag_tdo_o }]; #IO_L11P_T1_SRCC_13 Sch=jb_p[2]
60+
set_property -dict { PACKAGE_PIN V7 IOSTANDARD LVCMOS33 } [get_ports { jtag_tck_i }]; #IO_L11N_T1_SRCC_13 Sch=jb_n[2]
61+
62+
# --------------------------------------------------------------------------------------------------
63+
# Pmod Header JC
64+
# --------------------------------------------------------------------------------------------------
65+
set_property -dict { PACKAGE_PIN V15 IOSTANDARD LVCMOS33 } [get_ports { uart_rx_i }]; #IO_L10P_T1_34 Sch=jc_p[1]
66+
set_property -dict { PACKAGE_PIN W15 IOSTANDARD LVCMOS33 } [get_ports { uart_tx_o }]; #IO_L10N_T1_34 Sch=jc_n[1]
67+
68+
69+
70+
############
71+
# Switches #
72+
############
73+
74+
set_input_delay -min -clock $soc_clk [expr { $SOC_TCK * 0.10 }] [ \
75+
get_ports {fetch_en_i}]
76+
set_input_delay -max -clock $soc_clk [expr { $SOC_TCK * 0.35 }] [ \
77+
get_ports {fetch_en_i}]
78+
79+
set_max_delay [expr { 2 * $SOC_TCK }] -from [get_ports {fetch_en_i}]
80+
set_false_path -hold -from [get_ports {fetch_en_i}]
81+
82+
#################
83+
# Clock routing #
84+
#################
85+
86+
# JTAG is on non-clock-capable GPIOs (if not using BSCANE)
87+
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets -of [get_ports jtag_tck_i]]
88+
set_property CLOCK_BUFFER_TYPE NONE [get_nets -of [get_ports jtag_tck_i]]
89+
90+
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets -of [get_ports sys_reset*]]
91+
set_property CLOCK_BUFFER_TYPE NONE [get_nets -of [get_ports sys_reset*]]
92+
93+
# Remove avoid tc_clk_mux2 to use global clock routing
94+
set all_in_mux [get_nets -of [ get_pins -filter { DIRECTION == IN } -of \
95+
[get_cells -hier -filter { ORIG_REF_NAME == tc_clk_mux2 || REF_NAME == tc_clk_mux2 }]]]
96+
set_property CLOCK_DEDICATED_ROUTE FALSE $all_in_mux
97+
set_property CLOCK_BUFFER_TYPE NONE $all_in_mux
98+
99+
########
100+
# JTAG #
101+
########
102+
103+
# 10 MHz (max) JTAG clock
104+
set JTAG_TCK 100.0
105+
106+
# JTAG Clock
107+
create_clock -period $JTAG_TCK -name clk_jtag [get_ports jtag_tck_i]
108+
set_input_jitter clk_jtag 1.000
109+
110+
# JTAG Clock is asynchronous to all other clocks
111+
set_clock_groups -name jtag_async -asynchronous -group {clk_jtag}
112+
113+
set_input_delay -min -clock clk_jtag [expr { 0.10 * $JTAG_TCK }] [get_ports {jtag_tdi_i jtag_tms_i}]
114+
set_input_delay -max -clock clk_jtag [expr { 0.20 * $JTAG_TCK }] [get_ports {jtag_tdi_i jtag_tms_i}]
115+
116+
set_output_delay -min -clock clk_jtag [expr { 0.10 * $JTAG_TCK }] [get_ports jtag_tdo_o]
117+
set_output_delay -max -clock clk_jtag [expr { 0.20 * $JTAG_TCK }] [get_ports jtag_tdo_o]
118+
119+
# set_max_delay -from [get_ports jtag_trst_ni] $JTAG_TCK
120+
# set_false_path -hold -from [get_ports jtag_trst_ni]
121+
122+
########
123+
# UART #
124+
########
125+
126+
# UART speed is at most 5 Mb/s
127+
set UART_IO_SPEED 200.0
128+
129+
set_max_delay [expr { $UART_IO_SPEED * 0.35 }] -from [get_ports uart_rx_i]
130+
set_false_path -hold -from [get_ports uart_rx_i]
131+
132+
set_max_delay [expr { $UART_IO_SPEED * 0.35 }] -to [get_ports uart_tx_o]
133+
set_false_path -hold -to [get_ports uart_tx_o]
134+
135+
########
136+
# CDCs #
137+
########
138+
139+
# Disable hold checks on CDCs
140+
set_property KEEP_HIERARCHY SOFT [get_cells -hier \
141+
-filter {ORIG_REF_NAME=="sync" || REF_NAME=="sync"}]
142+
set_false_path -hold -through [get_pins -of_objects [get_cells -hier \
143+
-filter {ORIG_REF_NAME=="sync" || REF_NAME=="sync"}] -filter {NAME=~*serial_i}]
144+
145+
set_false_path -hold -through [get_pins -of_objects [get_cells -hier \
146+
-filter {ORIG_REF_NAME =~ cdc_*src* || REF_NAME =~ cdc_*src*}] -filter {NAME =~ *async*}]
147+
set_false_path -hold -through [get_pins -of_objects [get_cells -hier \
148+
-filter {ORIG_REF_NAME =~ cdc_*dst* || REF_NAME =~ cdc_*dst*}] -filter {NAME =~ *async*}]

0 commit comments

Comments
 (0)