Skip to content

Commit

Permalink
Added ultra96 board example
Browse files Browse the repository at this point in the history
  • Loading branch information
ilesser committed Oct 10, 2020
1 parent 2425dde commit cc9948a
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xilinx/examples/ultra96/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Building the ultra96 example - RapidWright
- Run `java -jar rapidwright_bbaexport.jar xczu3eg-sbva484-1-e xilinx/constids.inc xilinx/xczu7ev.bba`
- Run `./bbasm xilinx/xczu3eg.bba xilinx/xczu3eg.bin -b`
- Run `blinky.sh` in `xilinx/examples/ultra96`.

6 changes: 6 additions & 0 deletions xilinx/examples/ultra96/blinky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
yosys -p "synth_xilinx -flatten -arch xcup -nobram -top top; write_json blinky.json" ../attosoc/attosoc.v blinky.v
../../../nextpnr-xilinx --chipdb ../../xczu3eg.bin --json blinky.json --xdc ultra96.xdc --write blinky_routed.json
java -jar ../../../rapidwright_json2dcp.jar xczu3eg-sbva484-1-e blinky_routed.json blinky.dcp
vivado -mode batch -nojournal -nolog -source blinky.tcl
3 changes: 3 additions & 0 deletions xilinx/examples/ultra96/blinky.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
open_checkpoint blinky.dcp
write_verilog -force blinky_out.v
write_bitstream -force blinky.bit
40 changes: 40 additions & 0 deletions xilinx/examples/ultra96/blinky.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module top (input clk_p, clk_n, reset, output [3:0] led);
wire clk_i;
IBUFDS clk_ibuf (
.I(clk_p),
.IB(clk_n),
.O(clk_i)
);
BUFGCTRL bufg_i (
.I0(clk_i),
.CE0(1'b1),
.S0(1'b1),
.O(clk)
);

//`define BLINKY
`ifdef BLINKY
reg clkdiv;
reg [21:0] ctr;

always @(posedge clk) {clkdiv, ctr} <= ctr + 1'b1;

reg [3:0] led_r;

always @(posedge clk) begin
if (clkdiv)
led_r <= led_r - 1'b1;
end
assign led = led_r;
`else
wire [7:0] soc_led;

attosoc soc_i(
.clk(clk),
.reset(reset),
.led(soc_led)
);

assign led = soc_led[3:0];
`endif
endmodule
64 changes: 64 additions & 0 deletions xilinx/examples/ultra96/firmware.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
00100413
020004b7
01000993
00140413
01344463
00200413
00200913
00895e63
00040513
00090593
01c000ef
00050a63
00190913
fe9ff06f
0084a023
018000ef
fcdff06f
00100293
40b50533
fe555ee3
00008067
0036f2b7
e8028293
fff28293
fe029ee3
00008067
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
16 changes: 16 additions & 0 deletions xilinx/examples/ultra96/ultra96.xdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set_property LOC D5 [get_ports led[0]]
set_property LOC D6 [get_ports led[1]]
set_property LOC A5 [get_ports led[2]]
set_property LOC B5 [get_ports led[3]]

set_property IOSTANDARD LVCMOS33 [get_ports led[0]]
set_property IOSTANDARD LVCMOS33 [get_ports led[1]]
set_property IOSTANDARD LVCMOS33 [get_ports led[2]]
set_property IOSTANDARD LVCMOS33 [get_ports led[3]]

set_property LOC M11 [get_ports reset]
set_property IOSTANDARD LVCMOS33 [get_ports reset]

set_property LOC F23 [get_ports clk_p]
set_property LOC E23 [get_ports clk_n]
set_property IOSTANDARD LVDS [get_ports clk_p]

0 comments on commit cc9948a

Please sign in to comment.