aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pack_tests/locals.v
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-12 14:39:49 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-12 14:39:49 +0200
commit5a9ff4aea15fca7bcf8c86eaa1f92eb51f551e5b (patch)
tree564df207e96f08bb775ba9e9fd201429875409a3 /ice40/pack_tests/locals.v
parent95fb0595a591dd68ccb4b39ec0b20738ac047978 (diff)
downloadnextpnr-5a9ff4aea15fca7bcf8c86eaa1f92eb51f551e5b.tar.gz
nextpnr-5a9ff4aea15fca7bcf8c86eaa1f92eb51f551e5b.tar.bz2
nextpnr-5a9ff4aea15fca7bcf8c86eaa1f92eb51f551e5b.zip
ice40: Testing the placement validity check
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/pack_tests/locals.v')
-rw-r--r--ice40/pack_tests/locals.v27
1 files changed, 27 insertions, 0 deletions
diff --git a/ice40/pack_tests/locals.v b/ice40/pack_tests/locals.v
new file mode 100644
index 00000000..a1c5ea9f
--- /dev/null
+++ b/ice40/pack_tests/locals.v
@@ -0,0 +1,27 @@
+module top(input clk, cen, rst, ina, inb, output outa, outb, outc, outd);
+
+reg [31:0] temp = 0;
+
+integer i;
+
+always @(posedge clk)
+begin
+ if (cen) begin
+ if (rst) begin
+ temp <= 0;
+ end else begin
+ temp[0] <= ina;
+ temp[1] <= inb;
+ for (i = 2; i < 32; i++) begin
+ temp[i] <= temp[(i + 3) % 32] ^ temp[(i + 30) % 32] ^ temp[(i + 4) % 16] ^ temp[(i + 2) % 32];
+ end
+ end
+ end
+end
+
+assign outa = temp[3];
+assign outb = temp[5];
+assign outc = temp[9];
+assign outd = temp[15];
+
+endmodule