aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/examples/floorplan/floorplan.v
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-12-14 13:41:28 +0000
committerDavid Shah <dave@ds0.me>2019-03-22 10:31:54 +0000
commit1780f42b9a7854a8a7bf1f2d6589d3d35f133f87 (patch)
tree2e668d93ac8b58b908ef32667f689b5a5718af60 /ice40/examples/floorplan/floorplan.v
parent0118ac00c45c725a42b16697d1ac975f1be6f3b9 (diff)
downloadnextpnr-1780f42b9a7854a8a7bf1f2d6589d3d35f133f87.tar.gz
nextpnr-1780f42b9a7854a8a7bf1f2d6589d3d35f133f87.tar.bz2
nextpnr-1780f42b9a7854a8a7bf1f2d6589d3d35f133f87.zip
ice40: Add examples folder including floorplan example
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ice40/examples/floorplan/floorplan.v')
-rw-r--r--ice40/examples/floorplan/floorplan.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/ice40/examples/floorplan/floorplan.v b/ice40/examples/floorplan/floorplan.v
new file mode 100644
index 00000000..8f99ed4e
--- /dev/null
+++ b/ice40/examples/floorplan/floorplan.v
@@ -0,0 +1,22 @@
+module top(output LED1, LED2, LED3, LED4, LED5);
+ localparam N = 31;
+ wire [N:0] x;
+ assign x[0] = x[N];
+
+ genvar ii;
+ generate
+
+ for (ii = 0; ii < N; ii = ii + 1) begin
+ (* ringosc *)
+ SB_LUT4 #(.LUT_INIT(1)) lut_i(.I0(x[ii]), .I1(), .I2(), .I3(), .O(x[ii+1]));
+ end
+ endgenerate
+
+ assign clk = x[N];
+
+
+ reg [19:0] ctr;
+ always @(posedge clk)
+ ctr <= ctr + 1'b1;
+ assign {LED5, LED4, LED3, LED2, LED1} = ctr[19:15];
+endmodule