diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-01-01 00:32:28 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-01-01 00:32:28 +0100 |
commit | ed545ce4ce569bb96b2cba017daf2731afdaa926 (patch) | |
tree | 33e7629f0ae099a64c25dde8a657031c937a074e | |
parent | 3ee30532106d4aa92a0547730c992a06f0bbdef5 (diff) | |
download | icestorm-ed545ce4ce569bb96b2cba017daf2731afdaa926.tar.gz icestorm-ed545ce4ce569bb96b2cba017daf2731afdaa926.tar.bz2 icestorm-ed545ce4ce569bb96b2cba017daf2731afdaa926.zip |
icetime progress
-rw-r--r-- | icefuzz/icecube.sh | 6 | ||||
-rw-r--r-- | icetime/cells.v | 9 | ||||
-rw-r--r-- | icetime/icetime.cc | 6 | ||||
-rw-r--r-- | icetime/mktest.py | 104 |
4 files changed, 77 insertions, 48 deletions
diff --git a/icefuzz/icecube.sh b/icefuzz/icecube.sh index 55fb9bc..39f405b 100644 --- a/icefuzz/icecube.sh +++ b/icefuzz/icecube.sh @@ -1,8 +1,8 @@ #!/bin/bash # # Installing iCEcube2: -# - Install iCEcube2.2014.08 in /opt/lscc/iCEcube2.2015.08 -# - Install License in /opt/lscc/iCEcube2.2015.08/license.dat +# - Install iCEcube2.2014.08 in /opt/lscc/iCEcube2.2014.08 +# - Install License in /opt/lscc/iCEcube2.2014.08/license.dat # # Creating a project: # - <project_name>.v ## HDL sources (use "top" as name for the top module) @@ -33,7 +33,7 @@ if [ -z "$scriptdir" ]; then scriptdir="."; fi set -ex set -- ${1%.v} -icecubedir="${ICECUBEDIR:-/opt/lscc/iCEcube2.2015.08}" +icecubedir="${ICECUBEDIR:-/opt/lscc/iCEcube2.2014.08}" export SBT_DIR="$icecubedir/sbt_backend" export SYNPLIFY_PATH="$icecubedir/synpbase" export LM_LICENSE_FILE="$icecubedir/license.dat" diff --git a/icetime/cells.v b/icetime/cells.v index 32ee1a7..c4b2045 100644 --- a/icetime/cells.v +++ b/icetime/cells.v @@ -864,3 +864,12 @@ module INTERCONN(I, O); input I; output O; endmodule + +module SB_RAM40_4K(RDATA, RCLK, RCLKE, RE, RADDR, WCLK, WCLKE, WE, WADDR, MASK, WDATA); + output [15:0] RDATA; + input RCLK, RCLKE, RE; + input [10:0] RADDR; + input WCLK, WCLKE, WE; + input [10:0] WADDR; + input [15:0] MASK, WDATA; +endmodule diff --git a/icetime/icetime.cc b/icetime/icetime.cc index da8b51f..0a76836 100644 --- a/icetime/icetime.cc +++ b/icetime/icetime.cc @@ -12,7 +12,7 @@ #include <map> #include <set> -#define ZSPAN_HACK 0 +#define MAX_SPAN_HACK 1 FILE *fin, *fout; @@ -944,7 +944,7 @@ struct make_interconn_worker_t cell_log[trg] = std::make_pair(*cursor, "IoSpan4Mux"); } else { extra_vlog.push_back(stringf(" Span4Mux_%c%d %s (.I(%s), .O(%s));\n", - horiz ? 'h' : 'v', ZSPAN_HACK ? 0 : count_length, tname().c_str(), + horiz ? 'h' : 'v', MAX_SPAN_HACK ? 4 : count_length, tname().c_str(), seg_name(*cursor).c_str(), seg_name(trg).c_str())); cell_log[trg] = std::make_pair(*cursor, stringf("Span4Mux_%c%d", horiz ? 'h' : 'v', count_length)); } @@ -971,7 +971,7 @@ struct make_interconn_worker_t count_length = std::max(count_length, 0); extra_vlog.push_back(stringf(" Span12Mux_%c%d %s (.I(%s), .O(%s));\n", - horiz ? 'h' : 'v', ZSPAN_HACK ? 0 : count_length, tname().c_str(), + horiz ? 'h' : 'v', MAX_SPAN_HACK ? 12 : count_length, tname().c_str(), seg_name(*cursor).c_str(), seg_name(trg).c_str())); cell_log[trg] = std::make_pair(*cursor, stringf("Span12Mux_%c%d", horiz ? 'h' : 'v', count_length)); diff --git a/icetime/mktest.py b/icetime/mktest.py index c6c4c32..4ada54b 100644 --- a/icetime/mktest.py +++ b/icetime/mktest.py @@ -29,6 +29,26 @@ with open("%s.v" % sys.argv[1], "w") as f: print(" always @(posedge clk) dout <= din + {din[7:0], din[15:8]};", file=f) print(" assign {o3, o2, o1, o0} = dout >> din;", file=f) print("endmodule", file=f) + if mode == "test2": + io_names = [ "clk", "i0", "i1", "i2", "i3", "o0", "o1", "o2", "o3", "o4" ] + print(""" + module top(input clk, i0, i1, i2, i3, output reg o0, o1, o2, o3, o4); + reg [9:0] raddr, waddr, rdata, wdata; + reg [9:0] memory [0:1023]; + always @(posedge clk) begin + case ({i0, i1, i2}) + 0: raddr <= {raddr, i3}; + 1: waddr <= {waddr, i3}; + 2: wdata <= {wdata, i3}; + 3: rdata <= memory[raddr]; + 4: memory[waddr] <= wdata; + 5: rdata <= memory[waddr]; + 6: {o0, o1, o2, o3, o4} <= rdata[4:0]; + 7: {o0, o1, o2, o3, o4} <= rdata[9:5]; + endcase + end + endmodule + """, file=f) with open("%s.pcf" % sys.argv[1], "w") as f: for i, name in enumerate(io_names): @@ -55,48 +75,48 @@ os.rename("%s.v" % sys.argv[1], "%s_in.v" % sys.argv[1]) with open("%s_ref.v" % sys.argv[1], "w") as f: for line in open("%s.vsb" % sys.argv[1], "r"): - zspan_hack = False - - line = line.replace(" Span4Mux_s0_h ", " Span4Mux_h0 " if zspan_hack else " Span4Mux_h0 ") - line = line.replace(" Span4Mux_s1_h ", " Span4Mux_h0 " if zspan_hack else " Span4Mux_h1 ") - line = line.replace(" Span4Mux_s2_h ", " Span4Mux_h0 " if zspan_hack else " Span4Mux_h2 ") - line = line.replace(" Span4Mux_s3_h ", " Span4Mux_h0 " if zspan_hack else " Span4Mux_h3 ") - line = line.replace(" Span4Mux_h ", " Span4Mux_h0 " if zspan_hack else " Span4Mux_h4 ") - - line = line.replace(" Span4Mux_s0_v ", " Span4Mux_v0 " if zspan_hack else " Span4Mux_v0 ") - line = line.replace(" Span4Mux_s1_v ", " Span4Mux_v0 " if zspan_hack else " Span4Mux_v1 ") - line = line.replace(" Span4Mux_s2_v ", " Span4Mux_v0 " if zspan_hack else " Span4Mux_v2 ") - line = line.replace(" Span4Mux_s3_v ", " Span4Mux_v0 " if zspan_hack else " Span4Mux_v3 ") - line = line.replace(" Span4Mux_v ", " Span4Mux_v0 " if zspan_hack else " Span4Mux_v4 ") - line = line.replace(" Span4Mux ", " Span4Mux_v0 " if zspan_hack else " Span4Mux_v4 ") - - line = line.replace(" Span12Mux_s0_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h0 ") - line = line.replace(" Span12Mux_s1_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h1 ") - line = line.replace(" Span12Mux_s2_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h2 ") - line = line.replace(" Span12Mux_s3_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h3 ") - line = line.replace(" Span12Mux_s4_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h4 ") - line = line.replace(" Span12Mux_s5_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h5 ") - line = line.replace(" Span12Mux_s6_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h6 ") - line = line.replace(" Span12Mux_s7_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h7 ") - line = line.replace(" Span12Mux_s8_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h8 ") - line = line.replace(" Span12Mux_s9_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h9 ") - line = line.replace(" Span12Mux_s10_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h10 ") - line = line.replace(" Span12Mux_s11_h ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h11 ") - line = line.replace(" Span12Mux ", " Span12Mux_h0 " if zspan_hack else " Span12Mux_h12 ") - - line = line.replace(" Span12Mux_s0_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v0 ") - line = line.replace(" Span12Mux_s1_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v1 ") - line = line.replace(" Span12Mux_s2_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v2 ") - line = line.replace(" Span12Mux_s3_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v3 ") - line = line.replace(" Span12Mux_s4_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v4 ") - line = line.replace(" Span12Mux_s5_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v5 ") - line = line.replace(" Span12Mux_s6_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v6 ") - line = line.replace(" Span12Mux_s7_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v7 ") - line = line.replace(" Span12Mux_s8_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v8 ") - line = line.replace(" Span12Mux_s9_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v9 ") - line = line.replace(" Span12Mux_s10_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v10 ") - line = line.replace(" Span12Mux_s11_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v11 ") - line = line.replace(" Span12Mux_v ", " Span12Mux_v0 " if zspan_hack else " Span12Mux_v12 ") + max_span_hack = True + + line = line.replace(" Span4Mux_s0_h ", " Span4Mux_h4 " if max_span_hack else " Span4Mux_h0 ") + line = line.replace(" Span4Mux_s1_h ", " Span4Mux_h4 " if max_span_hack else " Span4Mux_h1 ") + line = line.replace(" Span4Mux_s2_h ", " Span4Mux_h4 " if max_span_hack else " Span4Mux_h2 ") + line = line.replace(" Span4Mux_s3_h ", " Span4Mux_h4 " if max_span_hack else " Span4Mux_h3 ") + line = line.replace(" Span4Mux_h ", " Span4Mux_h4 " if max_span_hack else " Span4Mux_h4 ") + + line = line.replace(" Span4Mux_s0_v ", " Span4Mux_v4 " if max_span_hack else " Span4Mux_v0 ") + line = line.replace(" Span4Mux_s1_v ", " Span4Mux_v4 " if max_span_hack else " Span4Mux_v1 ") + line = line.replace(" Span4Mux_s2_v ", " Span4Mux_v4 " if max_span_hack else " Span4Mux_v2 ") + line = line.replace(" Span4Mux_s3_v ", " Span4Mux_v4 " if max_span_hack else " Span4Mux_v3 ") + line = line.replace(" Span4Mux_v ", " Span4Mux_v4 " if max_span_hack else " Span4Mux_v4 ") + line = line.replace(" Span4Mux ", " Span4Mux_v4 " if max_span_hack else " Span4Mux_v4 ") + + line = line.replace(" Span12Mux_s0_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h0 ") + line = line.replace(" Span12Mux_s1_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h1 ") + line = line.replace(" Span12Mux_s2_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h2 ") + line = line.replace(" Span12Mux_s3_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h3 ") + line = line.replace(" Span12Mux_s4_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h4 ") + line = line.replace(" Span12Mux_s5_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h5 ") + line = line.replace(" Span12Mux_s6_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h6 ") + line = line.replace(" Span12Mux_s7_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h7 ") + line = line.replace(" Span12Mux_s8_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h8 ") + line = line.replace(" Span12Mux_s9_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h9 ") + line = line.replace(" Span12Mux_s10_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h10 ") + line = line.replace(" Span12Mux_s11_h ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h11 ") + line = line.replace(" Span12Mux ", " Span12Mux_h12 " if max_span_hack else " Span12Mux_h12 ") + + line = line.replace(" Span12Mux_s0_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v0 ") + line = line.replace(" Span12Mux_s1_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v1 ") + line = line.replace(" Span12Mux_s2_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v2 ") + line = line.replace(" Span12Mux_s3_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v3 ") + line = line.replace(" Span12Mux_s4_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v4 ") + line = line.replace(" Span12Mux_s5_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v5 ") + line = line.replace(" Span12Mux_s6_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v6 ") + line = line.replace(" Span12Mux_s7_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v7 ") + line = line.replace(" Span12Mux_s8_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v8 ") + line = line.replace(" Span12Mux_s9_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v9 ") + line = line.replace(" Span12Mux_s10_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v10 ") + line = line.replace(" Span12Mux_s11_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v11 ") + line = line.replace(" Span12Mux_v ", " Span12Mux_v12 " if max_span_hack else " Span12Mux_v12 ") f.write(line) |