Skip to content

Commit b94ba1f

Browse files
committed
badger: refresh documentation related to Spartan-6 resources
Update status.md with more software versions Make "make bits" work better
1 parent c540efe commit b94ba1f

File tree

9 files changed

+28
-23
lines changed

9 files changed

+28
-23
lines changed

badger/construct.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module construct #(
1717
// allowance Rx/Tx frequency offset.
1818
// At the other end, p_offset + max(fp_offset) < (2048-MTU-guard)
1919
) (
20-
input clk,
20+
input clk, // timespec 6.8 ns
2121
input [paw-1:0] gray_state,
2222
// port to MAC/IP config, single-cycle latency
2323
output [3:0] ip_a,

badger/ethernet_crc_add.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// raw_s is valid just for the (incoming) packet data.
77
// raw_l is also valid for a few cycles before, and 4 cycles after, that.
88
module ethernet_crc_add(
9-
input clk,
9+
input clk, // timespec 6.8 ns
1010
input raw_s,
1111
input raw_l,
1212
input [7:0] raw_d,

badger/scanner.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// The four submodules have relatively consistent ports and semantics.
2222

2323
module scanner (
24-
input clk,
24+
input clk, // timespec 6.8 ns
2525
input [7:0] eth_in,
2626
input eth_in_s,
2727
input eth_in_e, // error flag from PHY
@@ -324,7 +324,7 @@ module arp_patt(
324324
output pass
325325
);
326326

327-
reg [7:0] template;
327+
reg [7:0] template=0;
328328
always @(posedge clk) case(cnt[3:0])
329329
// template starts at 12th byte of Ethernet packet,
330330
// after the two MAC addresses.
@@ -362,7 +362,7 @@ module ip_patt(
362362
output [15:0] length
363363
);
364364

365-
reg [7:0] template;
365+
reg [7:0] template=0;
366366
always @(posedge clk) case(cnt[4:0])
367367
// template starts at 12th byte of Ethernet packet,
368368
// after the two MAC addresses.
@@ -441,7 +441,7 @@ module icmp_patt(
441441
output pass
442442
);
443443

444-
reg [7:0] template;
444+
reg [7:0] template=0;
445445
always @(posedge clk) case(cnt[2:0])
446446
// Ethernet/IP header is not in our scope
447447
// template starts at 23rd byte of Ethernet packet,

badger/status.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,22 @@ Synthesized by XST 14.7 for Spartan-6:
2424

2525
| **module** |**LUTs**|**RAMB16**|
2626
|:-------------------:|:-----:|:--------:|
27-
| scanner.v | 275 | |
28-
| construct.v | 192 | |
29-
| xformer.v | 93 | |
30-
| ethernet_crc_add.v | 94 | |
31-
| udp_port_cam_v | 31 | |
32-
| rtefi_blob.v | 1024 | 2 |
33-
| gmii_hw_test.v | 1242 | 4 |
27+
| scanner.v | 271 | |
28+
| construct.v | 192 | |
29+
| xformer.v | 93 | |
30+
| ethernet_crc_add.v | 94 | |
31+
| udp_port_cam_v | 31 | |
32+
| rtefi_blob.v | 1044 | 2 |
33+
| gmii_hw_test.v | 1582 | 6.5 |
3434

3535
This Verilog code is intentionally portable and standards-based.
3636
It has been tested using:
3737

38-
* verilator 3.900 (stock Debian stretch)
39-
* verilator 4.008 (git from December 2018)
40-
* iverilog 10.1 (stock Debian stretch)
41-
* iverilog 11.0 (git from December 2018)
38+
* verilator 3.900 through 5.032 (including 5.006 in stock Debian 12 bookworm)
39+
* iverilog 10.1 through 12.0 (including 11.0 in stock Debian 12 bookworm)
40+
* yosys 0.23 through 0.52 (including 0.23 in stock Debian 12 bookworm)
4241
* Xilinx XST 14.7
43-
* Xilinx Vivado 2015.3, 2017.4, 2018.1
42+
* Xilinx Vivado 2015.3, 2017.4, 2018.1, 2020.2
4443

4544
All the .eps files here are created with and editable by xcircuit.
4645

badger/tests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ hw_test_yosys.json: hw_test_skin.v $(HW_TEST_V)
218218
# experimental bitfiles, not for hardware
219219
# summarizes fabric footprints based on XST synthesizing for Spartan-6
220220
bits: scanner.bit construct.bit xformer.bit ethernet_crc_add.bit udp_port_cam_wrap.bit rtefi_blob.bit
221-
cd _xilinx && for f in $(basename $^); do echo $$f; grep "Slice LUT" $${f}_map.mrp; done
221+
cd _xilinx && for f in $(basename $^); do echo $$f; grep -E "of Slice LUT|of RAMB" $${f}_map.mrp; done
222222
scanner.bit: ones_chksum.v udp_port_cam.v crc8e_guts.v reg_tech_cdc.v
223223
construct.bit: ones_chksum.v construct_tx_table.v
224224
xformer.bit: hack_icmp_cksum.v reg_delay.v
225225
ethernet_crc_add.bit: crc8e_guts.v
226226
udp_port_cam_wrap.bit: udp_port_cam.v
227-
rtefi_blob.bit: $(RTEFI_V)
227+
rtefi_blob.bit: $(RTEFI_V) rtefi_blob.ucf
228228

229229
# =====
230230
# Make a bitfile for an SP605 with Xilinx XST

badger/tests/rtefi_blob.ucf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
NET "rx_clk" LOC="K21";
2+
NET "rx_clk" TNM_NET = "CLK_1";
3+
TIMESPEC "TS_CLK_1" = PERIOD "CLK_1" 6.8 ns HIGH 50%;
4+
NET "tx_clk" LOC="L20";
5+
NET "tx_clk" TNM_NET = "CLK_2";
6+
TIMESPEC "TS_CLK_2" = PERIOD "CLK_2" 6.8 ns HIGH 50%;

badger/udp_port_cam.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
module udp_port_cam #(
3333
parameter naw=3 // address width for abstract port memory
3434
) (
35-
input clk,
35+
input clk, // timespec 6.8 ns
3636
input port_s,
3737
input [7:0] data,
3838
// port to config memory, single-cycle latency

badger/xformer.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Uses the rearranged input packet and meta-information
33
// to create output packet, still sans CRC32.
44
module xformer(
5-
input clk,
5+
input clk, // timespec 6.8 ns
66
input [5:0] pc,
77
input [1:0] category,
88
input [2:0] udp_sel,

build-tools/xil_syn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ echo "\`include \"$XILINX/verilog/src/iSE/unisim_comp.v\"" >>"$DESIGN.prj"
188188
if test -z "$ucf"; then ucf="root/${DESIGN}.ucf"; fi
189189
if [ ! -r "$ucf" ]; then
190190
ucf=${DESIGN}.ucf
191-
perl -ne 'if (/(\w+)[,;]\s+\/\/ timespec\s+(.+)/) {print "NET \"$1\" LOC=\"'"${CLOCK_PIN}"'\";\nNET \"$1\" TNM_NET = \"CLK_1\";\nTIMESPEC \"TS_CLK_1\" = PERIOD \"CLK_1\" $2 HIGH 50%;\n"}' "root/$toplevel" >"$ucf"
191+
perl -ne 'if (/(\w+)[,;]\s+\/\/ timespec\s+(.+)/) {print "NET \"$1\" LOC=\"'"${CLOCK_PIN}"'\";\nNET \"$1\" TNM_NET = \"CLK_1\";\nTIMESPEC \"TS_CLK_1\" = PERIOD \"CLK_1\" $2 HIGH 50%;\n"}' "$toplevel" >"$ucf"
192192
fi
193193
test -r "$ucf" || BOMB="$BOMB $ucf"
194194

0 commit comments

Comments
 (0)