Skip to content

Commit 14e33a6

Browse files
committed
Initial support for Obsidian in badger/tests
rgmii_hw_test works on hardware Very slight rework of conditional code in rgmii_hw_test.v
1 parent 0c7aea9 commit 14e33a6

File tree

5 files changed

+105
-4
lines changed

5 files changed

+105
-4
lines changed

badger/tests/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,14 @@ marblem_rgmii_vtest.bit: marblem_rgmii_test.tcl marblem_rgmii_test.d badger.tcl
270270
$(SYNTH_VIVADO) $<
271271
mv _xilinx/marblem_rgmii_test.runs/impl_1/rgmii_hw_test.bit $@
272272

273+
# =====
274+
SYNTH_SOURCE_OBSIDIAN = rgmii_hw_test.v gmii_to_rgmii.v $(HW_TEST_V) marble/gmii_clock_handle.v $(FPGA_FAMILY_DIR)/xilinx/xilinx7_clocks.v
275+
obsidian_rgmii_test.d: $(SYNTH_SOURCE_OBSIDIAN) obsidian/obsidian_rgmii.xdc
276+
echo $^ | tr ' ' '\n' > $@
277+
obsidian_rgmii_vtest.bit: obsidian_rgmii_test.tcl obsidian_rgmii_test.d badger.tcl $(SYNTH_SOURCE_OBSIDIAN) obsidian/obsidian_rgmii.xdc
278+
$(SYNTH_VIVADO) $<
279+
mv _xilinx/obsidian_rgmii_test.runs/impl_1/rgmii_hw_test.bit $@
280+
273281
# =====
274282
# On-line test using Icarus and Linux's tun/tap feature
275283
rtefi_live: rtefi_pipe_tb.v $(RTEFI_V) fake_config_romx.v mac_compat_dpram.v tap-vpi.vpi

badger/tests/marblem_rgmii_test.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ source "badger.tcl"
22
set build_id "marblem_rgmii_test"
33
set chip_id "xc7a100t-fgg484-2"
44
set top_module "rgmii_hw_test"
5-
set verilog_defines [list "CHIP_FAMILY_7SERIES" "MARBLE_TEST"]
5+
set verilog_defines [list "CHIP_FAMILY_7SERIES" "MARBLE_TEST" "USE_IN_PHASE_PHY_CLK"]
66
badger_build $build_id $chip_id $top_module $verilog_defines
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Obsidian
2+
# https://github.com/BerkeleyLab/Obsidian
3+
# compare and contrast the contents of this file with
4+
# https://github.com/litex-hub/litex-boards/blob/master/litex_boards/platforms/berkeleylab_obsidian.py
5+
6+
# RGMII PHY
7+
set_property -dict {PACKAGE_PIN A13 IOSTANDARD LVCMOS33} [get_ports PHY_RSTN]
8+
9+
set_property -dict {PACKAGE_PIN E13 IOSTANDARD LVCMOS33} [get_ports RGMII_RX_CLK]
10+
set_property -dict {PACKAGE_PIN D16 IOSTANDARD LVCMOS33} [get_ports RGMII_RX_CTRL]
11+
set_property -dict {PACKAGE_PIN B16 IOSTANDARD LVCMOS33} [get_ports {RGMII_RXD[0]}]
12+
set_property -dict {PACKAGE_PIN C16 IOSTANDARD LVCMOS33} [get_ports {RGMII_RXD[1]}]
13+
set_property -dict {PACKAGE_PIN D14 IOSTANDARD LVCMOS33} [get_ports {RGMII_RXD[2]}]
14+
set_property -dict {PACKAGE_PIN C13 IOSTANDARD LVCMOS33} [get_ports {RGMII_RXD[3]}]
15+
16+
set_property -dict {PACKAGE_PIN D15 IOSTANDARD LVCMOS33} [get_ports RGMII_TX_CLK]
17+
set_property -dict {PACKAGE_PIN A17 IOSTANDARD LVCMOS33} [get_ports RGMII_TX_CTRL]
18+
set_property -dict {PACKAGE_PIN B17 IOSTANDARD LVCMOS33} [get_ports {RGMII_TXD[0]}]
19+
set_property -dict {PACKAGE_PIN E16 IOSTANDARD LVCMOS33} [get_ports {RGMII_TXD[1]}]
20+
set_property -dict {PACKAGE_PIN E17 IOSTANDARD LVCMOS33} [get_ports {RGMII_TXD[2]}]
21+
set_property -dict {PACKAGE_PIN D18 IOSTANDARD LVCMOS33} [get_ports {RGMII_TXD[3]}]
22+
23+
# https://adaptivesupport.amd.com/s/article/53092?language=en_US
24+
set_property IOB TRUE [get_ports {RGMII_TXD[*]}]
25+
set_property IOB TRUE [get_ports RGMII_TX_CTRL]
26+
set_property IOB TRUE [get_ports {RGMII_RXD[*]}]
27+
set_property IOB TRUE [get_ports RGMII_RX_CTRL]
28+
29+
# Rx clock constraint
30+
create_clock -period 8.00 -name phy_rxclk [get_ports RGMII_RX_CLK]
31+
32+
# QSPI Boot Flash
33+
set_property -dict {PACKAGE_PIN L15 IOSTANDARD LVCMOS33} [get_ports BOOT_CS_B]
34+
set_property -dict {PACKAGE_PIN K16 IOSTANDARD LVCMOS33} [get_ports BOOT_MOSI]
35+
set_property -dict {PACKAGE_PIN L17 IOSTANDARD LVCMOS33} [get_ports BOOT_MISO]
36+
# FPGA_CCLK is special, and doesn't show up here;
37+
# access is accomplished by instantiating the STARTUPE2 primitive
38+
39+
# LEDs
40+
set_property -dict {PACKAGE_PIN M16 IOSTANDARD LVCMOS33} [get_ports {LED[0]}]
41+
set_property -dict {PACKAGE_PIN N17 IOSTANDARD LVCMOS33} [get_ports {LED[1]}]
42+
set_property -dict {PACKAGE_PIN R18 IOSTANDARD LVCMOS33} [get_ports {LED[2]}]
43+
set_property -dict {PACKAGE_PIN U16 IOSTANDARD LVCMOS33} [get_ports {LED[3]}]
44+
# LED_0 connects to PMOD1_0
45+
# LED_1 connects to PMOD1_1
46+
# LED_2 connects to PMOD1_2
47+
# LED_3 connects to PMOD1_3
48+
# To gain access to these blinkenlights, it's suggested to plug in a
49+
# usual Diglent PmodLED to the top half of J4 (a.k.a. PMOD1).
50+
51+
# Possible connection to supervisory microcontroller
52+
# Want actual pins here so the synthesizer doesn't drop the supporting logic;
53+
# I have no short-term plans to exercise these pins in hardware.
54+
# See projects/test_marble_family to demo that feature.
55+
# SCLK connects to PMOD1_4
56+
# CSB connects to PMOD1_5
57+
# MOSI connects to PMOD1_6
58+
set_property -dict {PACKAGE_PIN M17 IOSTANDARD LVCMOS33} [get_ports SCLK]
59+
set_property -dict {PACKAGE_PIN N18 IOSTANDARD LVCMOS33} [get_ports CSB]
60+
set_property -dict {PACKAGE_PIN P18 IOSTANDARD LVCMOS33} [get_ports MOSI]
61+
62+
# 125 MHz from White Rabbit comes in via MGTREFCLK;
63+
# we should really turn on the GTP and use its TXOUTCLK.
64+
# 20 MHz CLK20_VCXO from Y3 is a poor substitute
65+
set_property -dict {PACKAGE_PIN D13 IOSTANDARD LVCMOS33} [get_ports SYSCLK_P]
66+
create_clock -name sys_clk -period 50.00 [get_ports SYSCLK_P]
67+
# this property setting is correct: the CLK20_VCXO pin is only used for its _frequency_, not as a phase
68+
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets SYSCLK_P]
69+
70+
# Miscellaneous
71+
# Accidentally unavailable; substitute PMOD1_7, and trust that the
72+
# unconnected Y3-2 will float high (R176 should help)
73+
set_property -dict {PACKAGE_PIN V17 IOSTANDARD LVCMOS33} [get_ports VCXO_EN]
74+
# RESET not actually used in gateware or available on hardware
75+
# Assign it to PMOD2_0 anyway
76+
set_property -dict {PACKAGE_PIN T18 IOSTANDARD LVCMOS33} [get_ports RESET]
77+
78+
# Clock groups
79+
set_clock_groups -name async_clks -asynchronous \
80+
-group [get_clocks -include_generated_clocks sys_clk] \
81+
-group [get_clocks -include_generated_clocks phy_rxclk]
82+
83+
# Bank 0 setup
84+
set_property CFGBVS VCCO [current_design]
85+
set_property CONFIG_VOLTAGE 3.3 [current_design]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source "badger.tcl"
2+
set build_id "obsidian_rgmii_test"
3+
set chip_id "xc7a35t-csg325-2"
4+
set top_module "rgmii_hw_test"
5+
set verilog_defines [list "CHIP_FAMILY_7SERIES" "MARBLE_TEST"]
6+
badger_build $build_id $chip_id $top_module $verilog_defines

badger/tests/rgmii_hw_test.v

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RGMII Hardware Test
22
// mostly just instantiates hw_test
3-
// Initial target is AC701
3+
// Initial target is AC701; also used for Marble-Mini and Obsidian
44
module rgmii_hw_test(
5-
// 200 MHz typical
5+
// 200 MHz differential on AC701
66
input SYSCLK_P,
77
`ifndef MARBLE_TEST
88
input SYSCLK_N,
@@ -46,12 +46,14 @@ module rgmii_hw_test(
4646
`ifdef MARBLE_TEST
4747
assign VCXO_EN = 1;
4848
wire SYSCLK_N = 0;
49+
`endif
50+
`ifdef USE_IN_PHASE_PHY_CLK
4951
parameter in_phase_tx_clk = 1;
5052
`else
5153
parameter in_phase_tx_clk = 0;
5254
`endif
5355

54-
// Standardized interface, hardware-dependent implementation
56+
// Standardized interface, with hardware-dependent implementation
5557
wire tx_clk, tx_clk90;
5658
wire clk_locked;
5759
wire pll_reset = 0; // or RESET?

0 commit comments

Comments
 (0)