forked from f4pga/f4pga-arch-defs
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from mithro/ice40-top-routing-fix
ice40: Getting the top-routing mode working
- Loading branch information
Showing
4 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// 4-input LUT test. | ||
module luta(input [3:0] I, output O); | ||
always @(I) | ||
case(I) | ||
4'b1000 : O = 1; | ||
4'b1001 : O = 1; | ||
4'b1010 : O = 1; | ||
4'b1100 : O = 1; | ||
4'b1110 : O = 1; | ||
4'b1111 : O = 1; | ||
default : O = 0; | ||
endcase | ||
endmodule // top | ||
|
||
module lutb(input [3:0] I, output O); | ||
always @(I) | ||
case(I) | ||
4'b1001 : O = 1; | ||
4'b1010 : O = 1; | ||
4'b1100 : O = 1; | ||
4'b1110 : O = 1; | ||
4'b1111 : O = 1; | ||
default : O = 0; | ||
endcase | ||
endmodule // top | ||
|
||
module top(input [6:0] I, output O); | ||
wire cascade; | ||
|
||
luta luta_i (I[3:0], cascade); | ||
lutb lutb_i ({cascade, I[6:3]}, O); | ||
|
||
endmodule // top |