mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-19 20:33:39 +00:00
Improve igloo2 exmaple
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
bfcd46dbd3
commit
24d1b92eda
4 changed files with 16 additions and 8 deletions
|
@ -1 +1,8 @@
|
||||||
# Add placement constraints here
|
# Add placement constraints here
|
||||||
|
set_io clk -pinname H16 -fixed yes -DIRECTION INPUT
|
||||||
|
set_io SW1 -pinname H12 -fixed yes -DIRECTION INPUT
|
||||||
|
set_io SW2 -pinname H13 -fixed yes -DIRECTION INPUT
|
||||||
|
set_io LED1 -pinname J16 -fixed yes -DIRECTION OUTPUT
|
||||||
|
set_io LED2 -pinname M16 -fixed yes -DIRECTION OUTPUT
|
||||||
|
set_io LED3 -pinname K16 -fixed yes -DIRECTION OUTPUT
|
||||||
|
set_io LED4 -pinname N16 -fixed yes -DIRECTION OUTPUT
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
# Add timing constraints here
|
# Add timing constraints here
|
||||||
|
create_clock -period 10.000 -waveform {0.000 5.000} [get_ports {clk}]
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
module example (
|
module example (
|
||||||
input clk,
|
input clk,
|
||||||
input EN,
|
input SW1,
|
||||||
|
input SW2,
|
||||||
output LED1,
|
output LED1,
|
||||||
output LED2,
|
output LED2,
|
||||||
output LED3,
|
output LED3,
|
||||||
output LED4,
|
output LED4
|
||||||
output LED5
|
|
||||||
);
|
);
|
||||||
|
|
||||||
localparam BITS = 5;
|
localparam BITS = 4;
|
||||||
localparam LOG2DELAY = 22;
|
localparam LOG2DELAY = 22;
|
||||||
|
|
||||||
reg [BITS+LOG2DELAY-1:0] counter = 0;
|
reg [BITS+LOG2DELAY-1:0] counter = 0;
|
||||||
reg [BITS-1:0] outcnt;
|
reg [BITS-1:0] outcnt;
|
||||||
|
|
||||||
always @(posedge clk) begin
|
always @(posedge clk) begin
|
||||||
counter <= counter + EN;
|
counter <= counter + SW1 + SW2 + 1;
|
||||||
outcnt <= counter >> LOG2DELAY;
|
outcnt <= counter >> LOG2DELAY;
|
||||||
end
|
end
|
||||||
|
|
||||||
assign {LED1, LED2, LED3, LED4, LED5} = outcnt ^ (outcnt >> 1);
|
assign {LED1, LED2, LED3, LED4} = outcnt ^ (outcnt >> 1);
|
||||||
endmodule
|
endmodule
|
||||||
|
|
|
@ -8,8 +8,8 @@ new_project \
|
||||||
-block_mode 0 \
|
-block_mode 0 \
|
||||||
-hdl "VERILOG" \
|
-hdl "VERILOG" \
|
||||||
-family IGLOO2 \
|
-family IGLOO2 \
|
||||||
-die PA4MGL500 \
|
-die PA4MGL2500 \
|
||||||
-package tq144 \
|
-package vf256 \
|
||||||
-speed -1
|
-speed -1
|
||||||
|
|
||||||
import_files -hdl_source {netlist.vm}
|
import_files -hdl_source {netlist.vm}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue