diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-11-19 15:40:39 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-11-19 15:40:39 -0800 |
commit | 09ee96e8c22ec692ee3ee31b8c211646eabbcf27 (patch) | |
tree | 8b24dad9db0013ee3db20326b00941bd2abb10d1 /tests/ice40/macc.v | |
parent | 304e5f9ea45b8a4e2a28aba7f2820d1862377fef (diff) | |
parent | 7ea0a5937ba2572f6d9d62e73e24df480c49561d (diff) | |
download | yosys-09ee96e8c22ec692ee3ee31b8c211646eabbcf27.tar.gz yosys-09ee96e8c22ec692ee3ee31b8c211646eabbcf27.tar.bz2 yosys-09ee96e8c22ec692ee3ee31b8c211646eabbcf27.zip |
Merge remote-tracking branch 'origin/master' into xaig_dff
Diffstat (limited to 'tests/ice40/macc.v')
-rw-r--r-- | tests/ice40/macc.v | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/ice40/macc.v b/tests/ice40/macc.v deleted file mode 100644 index 6f68e7500..000000000 --- a/tests/ice40/macc.v +++ /dev/null @@ -1,47 +0,0 @@ -/* -Example from: https://www.latticesemi.com/-/media/LatticeSemi/Documents/UserManuals/EI/iCEcube201701UserGuide.ashx?document_id=52071 [p. 77]. -*/ -module top(clk,a,b,c,set); -parameter A_WIDTH = 6 /*4*/; -parameter B_WIDTH = 6 /*3*/; -input set; -input clk; -input signed [(A_WIDTH - 1):0] a; -input signed [(B_WIDTH - 1):0] b; -output signed [(A_WIDTH + B_WIDTH - 1):0] c; -reg [(A_WIDTH + B_WIDTH - 1):0] reg_tmp_c; -assign c = reg_tmp_c; -always @(posedge clk) -begin - if(set) - begin - reg_tmp_c <= 0; - end - else - begin - reg_tmp_c <= a * b + c; - end -end -endmodule - -module top2(clk,a,b,c,hold); -parameter A_WIDTH = 6 /*4*/; -parameter B_WIDTH = 6 /*3*/; -input hold; -input clk; -input signed [(A_WIDTH - 1):0] a; -input signed [(B_WIDTH - 1):0] b; -output signed [(A_WIDTH + B_WIDTH - 1):0] c; -reg signed [A_WIDTH-1:0] reg_a; -reg signed [B_WIDTH-1:0] reg_b; -reg [(A_WIDTH + B_WIDTH - 1):0] reg_tmp_c; -assign c = reg_tmp_c; -always @(posedge clk) -begin - if (!hold) begin - reg_a <= a; - reg_b <= b; - reg_tmp_c <= reg_a * reg_b + c; - end -end -endmodule |