mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-18 11:58:32 +00:00
Merge pull request #851 from kprasadvnsi/master
Added examples/anlogic/
This commit is contained in:
commit
ba0da6371e
7 changed files with 55 additions and 0 deletions
4
examples/anlogic/.gitignore
vendored
Normal file
4
examples/anlogic/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
demo.bit
|
||||||
|
demo_phy.area
|
||||||
|
full.v
|
||||||
|
*.log
|
13
examples/anlogic/README
Normal file
13
examples/anlogic/README
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
LED Blink project for Anlogic Lichee Tang board.
|
||||||
|
|
||||||
|
Follow the install instructions for the Tang Dynasty IDE from given link below.
|
||||||
|
|
||||||
|
https://tang.sipeed.com/en/getting-started/installing-td-ide/linux/
|
||||||
|
|
||||||
|
|
||||||
|
set TD_HOME env variable to the full path to the TD <TD Install Directory> as follow.
|
||||||
|
|
||||||
|
export TD_HOME=<TD Install Directory>
|
||||||
|
|
||||||
|
then run "bash build.sh" in this directory.
|
||||||
|
|
4
examples/anlogic/build.sh
Executable file
4
examples/anlogic/build.sh
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -ex
|
||||||
|
yosys demo.ys
|
||||||
|
$TD_HOME/bin/td build.tcl
|
11
examples/anlogic/build.tcl
Normal file
11
examples/anlogic/build.tcl
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import_device eagle_s20.db -package BG256
|
||||||
|
read_verilog full.v -top demo
|
||||||
|
read_adc demo.adc
|
||||||
|
optimize_rtl
|
||||||
|
map_macro
|
||||||
|
map
|
||||||
|
pack
|
||||||
|
place
|
||||||
|
route
|
||||||
|
report_area -io_info -file demo_phy.area
|
||||||
|
bitgen -bit demo.bit -version 0X00 -g ucode:00000000000000000000000000000000
|
2
examples/anlogic/demo.adc
Normal file
2
examples/anlogic/demo.adc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
set_pin_assignment {CLK_IN} { LOCATION = K14; } ##24MHZ
|
||||||
|
set_pin_assignment {R_LED} { LOCATION = R3; } ##R_LED
|
18
examples/anlogic/demo.v
Normal file
18
examples/anlogic/demo.v
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
module demo (
|
||||||
|
input wire CLK_IN,
|
||||||
|
output wire R_LED
|
||||||
|
);
|
||||||
|
parameter time1 = 30'd12_000_000;
|
||||||
|
reg led_state;
|
||||||
|
reg [29:0] count;
|
||||||
|
|
||||||
|
always @(posedge CLK_IN)begin
|
||||||
|
if(count == time1)begin
|
||||||
|
count<= 30'd0;
|
||||||
|
led_state <= ~led_state;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
count <= count + 1'b1;
|
||||||
|
end
|
||||||
|
assign R_LED = led_state;
|
||||||
|
endmodule
|
3
examples/anlogic/demo.ys
Normal file
3
examples/anlogic/demo.ys
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
read_verilog demo.v
|
||||||
|
synth_anlogic -top demo
|
||||||
|
write_verilog full.v
|
Loading…
Add table
Add a link
Reference in a new issue