-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
131 additions
and
0 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,71 @@ | ||
\m4_TLV_version 1d: tl-x.org | ||
\SV | ||
m4+definitions([' | ||
m4_include_url(['https://raw.githubusercontent.com/stevehoover/makerchip_examples/ceebf870862e222ebc6eaf92d5a7fb85a525d069/1st-claas_template_with_macros.tlv']) | ||
']) | ||
m4_makerchip_module_with_random_kernel_tb(my, ['assign passed = cyc_cnt > 20;']) | ||
m4+definitions(['']) // A hack to reset line alignment to address the fact that the above macro is multi-line. | ||
\TLV | ||
// A default direct hookup from |in to |out. | ||
m4+tlv_wrapper(|in, @0, |out, @0, /trans) | ||
|in | ||
@0 | ||
$data[31:0] = >>1$output; | ||
@1 | ||
// Calculator logic | ||
// Extract input fields from input data | ||
$val1[31:0] = >>1$output; | ||
$val2[31:0] = /trans$data[31:0]; | ||
$op[2:0] = /trans$data[34:32]; | ||
//counter | ||
$counter = $reset?0:(>>1$counter+1); | ||
$valid = $reset || $counter; | ||
?$valid | ||
@1 | ||
$sum[31:0] = $val1[31:0] + $val2[31:0]; | ||
$diff[31:0] = $val1[31:0] - $val2[31:0]; | ||
$mult[31:0] = $val1[31:0] * $val2[31:0]; | ||
$quot[31:0] = $val1[31:0] / $val2[31:0]; | ||
//@2 | ||
$mem[31:0] = | ||
$reset ? 0: | ||
($op[2:0]==3'b101) | ||
? >>1$mem[31:0] : >>1$output; | ||
|
||
|
||
$output[31:0] = | ||
$reset ? 0: | ||
($op[2:0]==3'b000) | ||
? $sum[31:0] : | ||
($op[2:0]==3'b001) | ||
? $diff[31:0] : | ||
($op[2:0]==3'b010) | ||
? $mult[31:0] : | ||
($op[2:0]==3'b011) | ||
? $quot[31:0] : | ||
($op[2:0]==3'b100) | ||
? >>1$mem[31:0] : $val1[31:0]; | ||
|
||
|
||
|out | ||
@0 | ||
// Hook up inputs to outputs to implement a no-op kernel. | ||
// Delete this to add your kernel. | ||
$ANY = /top|in<>0$ANY; | ||
|
||
$ready = *out_ready; | ||
*out_avail = $avail; | ||
*out_data = $data; | ||
//`BOGUS_USE($op $rand $ready) | ||
`BOGUS_USE($ready) | ||
|
||
// Extract output data to the output field | ||
/trans@0$data = |in@1$output; | ||
|
||
m4+rename_flow(/top, |in, @0, |out, @0, /trans) | ||
\SV | ||
endmodule |
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,46 @@ | ||
|
||
Viewed | ||
@@ -0,0 +1,43 @@ | ||
\m4_TLV_version 1d: tl-x.org | ||
m4+definitions([' | ||
// This file can be used to build a coarsely-configured implementation of WARP-V within makerchip.com. | ||
// This enables exploration of a generated model (as TL-Verilog (without M4 macros) and/or Verilog/SystemVerilog). | ||
// Simulation waveforms can be explored. | ||
// | ||
// High-level settings are described here. For detailed settings, consult the included warp-v.tlv file. | ||
// ----------------------------------------------------------- | ||
// CONFIGURATION: | ||
// ISA. Legal Values: [MINI, RISCV, MIPSI, POWER, DUMMY] | ||
m4_define(M4_ISA, RISCV) | ||
// Standard configuration. Legal Values: [1-stage, 4-stage, 6-stage, none (and define individual parameters)] | ||
m4_define(M4_STANDARD_CONFIG, 4-stage) | ||
// OPTIONAL CONFIGURATION: | ||
// Branch predictor. Legal Values: [fallthrough, two_bit] | ||
// m4_define(M4_BRANCH_PRED, fallthrough) | ||
// DETAILED CONFIGURATION: | ||
// (See included warp-v.tlv) | ||
// ----------------------------------------------------------- | ||
']) | ||
\SV | ||
// Include WARP-V. | ||
m4_include_lib(['https://raw.githubusercontent.com/stevehoover/warp-v/master/warp-v.tlv']) | ||
|
||
m4+module_def | ||
\TLV | ||
m4+warpv() | ||
m4+warpv_makerchip_cnt10_tb() | ||
m4+makerchip_pass_fail() | ||
\SV | ||
endmodule |
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
Submodule tlv-vscode
added at
af933c