mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-02 00:00:44 +00:00
Add new tests.
This commit is contained in:
parent
eb0a5b2293
commit
d144748401
10 changed files with 200 additions and 0 deletions
19
tests/ice40/alu.v
Normal file
19
tests/ice40/alu.v
Normal file
|
@ -0,0 +1,19 @@
|
|||
module top (
|
||||
input clock,
|
||||
input [31:0] dinA, dinB,
|
||||
input [2:0] opcode,
|
||||
output reg [31:0] dout
|
||||
);
|
||||
always @(posedge clock) begin
|
||||
case (opcode)
|
||||
0: dout <= dinA + dinB;
|
||||
1: dout <= dinA - dinB;
|
||||
2: dout <= dinA >> dinB;
|
||||
3: dout <= $signed(dinA) >>> dinB;
|
||||
4: dout <= dinA << dinB;
|
||||
5: dout <= dinA & dinB;
|
||||
6: dout <= dinA | dinB;
|
||||
7: dout <= dinA ^ dinB;
|
||||
endcase
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue