Skip to content

Commit f98aba7

Browse files
committed
Correct verilog for Op_at from eda7dc4
1 parent 0359684 commit f98aba7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hw/verilog/tenyr.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ module Exec(input clk, en, output reg done, output reg[31:0] valZ,
5656
reg[3:0] rop;
5757
reg add, act, staged;
5858

59-
function [31:0] Op_at(input[31:0] rA, rB);
60-
return {32{(rA >> rB) & 1'b1}};
59+
function Bit(input[31:0] rA, rB);
60+
return rA >> rB;
6161
endfunction
6262

6363
always @(posedge clk) begin
@@ -70,7 +70,7 @@ module Exec(input clk, en, output reg done, output reg[31:0] valZ,
7070
4'h3: rY <= (rA >>> rB) ; 4'hb: rY <= (rA >> rB );
7171
4'h4: rY <= (rA + rB) ; 4'hc: rY <= (rA - rB );
7272
4'h5: rY <= (rA * rB) ; 4'hd: rY <= (rA << rB );
73-
4'h6: rY <= {32{rA == rB}}; 4'he: rY <= Op_at(rA, rB);
73+
4'h6: rY <= {32{rA == rB}}; 4'he: rY <= {32{Bit(rA, rB)}};
7474
4'h7: rY <= {32{rA < rB}}; 4'hf: rY <= {32{rA >= rB }};
7575
endcase
7676
if (act) rZ <= rY + rC;

0 commit comments

Comments
 (0)