Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 133 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
7230ccd
Setting up GitHub Classroom Feedback
shivanishah269 Oct 23, 2020
d81b6ab
Update calculator_solutions.tlv
Harishwar10 Oct 23, 2020
d1d13ee
Update README.md
Harishwar10 Oct 23, 2020
128ca4a
Create Free_Running_oscillator
Harishwar10 Oct 23, 2020
669f9da
Create Sequential_Calculator
Harishwar10 Oct 23, 2020
7103b3b
Create Cycle_calculator
Harishwar10 Oct 23, 2020
99eda98
Update calculator_solutions.tlv
Harishwar10 Oct 24, 2020
638cc99
Update calculator_solutions.tlv
Harishwar10 Oct 24, 2020
c62add4
Update risc-v_solutions.tlv
Harishwar10 Oct 25, 2020
c255fe5
Update risc-v_solutions.tlv
Harishwar10 Oct 25, 2020
1fb2b7e
Create LICENSE
Harishwar10 Oct 25, 2020
419283a
Merge pull request #2 from RISCV-MYTH-WORKSHOP/add-license-1
Harishwar10 Oct 25, 2020
182ff90
Rename LICENSE to LICENSE.md
Harishwar10 Oct 25, 2020
c3a17ac
Update README.md
Harishwar10 Oct 25, 2020
af157b1
Update README.md
Harishwar10 Oct 25, 2020
8b23cc9
Update README.md
Harishwar10 Oct 25, 2020
368af44
Update README.md
Harishwar10 Oct 25, 2020
9aa2d19
Update README.md
Harishwar10 Oct 25, 2020
e699371
Update README.md
Harishwar10 Oct 25, 2020
23afc09
Update README.md
Harishwar10 Oct 25, 2020
6495347
Update README.md
Harishwar10 Oct 25, 2020
98108b0
Update README.md
Harishwar10 Oct 25, 2020
3612ea0
Update README.md
Harishwar10 Oct 25, 2020
1ac1cc5
Update README.md
Harishwar10 Oct 25, 2020
0b1b364
Update README.md
Harishwar10 Oct 25, 2020
898c00e
Update README.md
Harishwar10 Oct 25, 2020
b97c0da
Update README.md
Harishwar10 Oct 25, 2020
be32a05
Create simple.txt
Harishwar10 Oct 25, 2020
2aabf91
Update README.md
Harishwar10 Oct 26, 2020
53b08d9
Update README.md
Harishwar10 Oct 26, 2020
b89c1af
Update README.md
Harishwar10 Oct 26, 2020
4cdfe5c
Update README.md
Harishwar10 Oct 26, 2020
4cd619b
Update README.md
Harishwar10 Oct 26, 2020
ff59cae
Update README.md
Harishwar10 Oct 26, 2020
d4c62ef
Update README.md
Harishwar10 Oct 26, 2020
b6a591f
Update README.md
Harishwar10 Oct 26, 2020
525db74
Update README.md
Harishwar10 Oct 26, 2020
bf1f8f7
Update README.md
Harishwar10 Oct 26, 2020
9d29752
Update README.md
Harishwar10 Oct 26, 2020
437159a
Update README.md
Harishwar10 Oct 26, 2020
f0eac44
Update README.md
Harishwar10 Oct 26, 2020
ef01f19
Update README.md
Harishwar10 Oct 26, 2020
d0ae93e
Update README.md
Harishwar10 Oct 26, 2020
263f61f
Update README.md
Harishwar10 Oct 26, 2020
dd296a0
Update README.md
Harishwar10 Oct 26, 2020
ba341b2
Update README.md
Harishwar10 Oct 26, 2020
c13d9e9
Update README.md
Harishwar10 Oct 26, 2020
ca8ec73
Update README.md
Harishwar10 Oct 26, 2020
556de35
Update README.md
Harishwar10 Oct 26, 2020
ac56e37
Update README.md
Harishwar10 Oct 26, 2020
13b1cd7
Update README.md
Harishwar10 Oct 26, 2020
af6ff3c
Update README.md
Harishwar10 Oct 26, 2020
9895573
Update README.md
Harishwar10 Oct 26, 2020
ccb2d0c
Update README.md
Harishwar10 Oct 26, 2020
3e89320
Rename Cycle_calculator to Day3_5/Cycle_calculator
Harishwar10 Oct 26, 2020
fb581a4
Rename Free_Running_oscillator to Day3_5/Free_Running_oscillator
Harishwar10 Oct 26, 2020
f39cf0e
Rename Sequential_Calculator to Day3_5/Sequential_Calculator
Harishwar10 Oct 26, 2020
a6881a0
Delete README.md
Harishwar10 Oct 26, 2020
4a3d7f9
Update README.md
Harishwar10 Oct 26, 2020
1b1605c
Update README.md
Harishwar10 Oct 26, 2020
a0896b2
Update README.md
Harishwar10 Oct 26, 2020
ee144f2
Update README.md
Harishwar10 Oct 26, 2020
fb7cf2c
Update README.md
Harishwar10 Oct 26, 2020
84d97f9
Update README.md
Harishwar10 Oct 26, 2020
1c2fe36
Update README.md
Harishwar10 Oct 26, 2020
80bc30b
Update README.md
Harishwar10 Oct 26, 2020
0a0f671
Update README.md
Harishwar10 Oct 26, 2020
ba6877d
Create readme
Harishwar10 Oct 26, 2020
3c1a60e
Update README.md
Harishwar10 Oct 26, 2020
96db9b3
Add files via upload
Harishwar10 Oct 26, 2020
7d3e54a
Update README.md
Harishwar10 Oct 26, 2020
945cfd8
Update README.md
Harishwar10 Oct 26, 2020
8e7bf16
Update README.md
Harishwar10 Oct 26, 2020
78378e9
Update README.md
Harishwar10 Oct 26, 2020
b23d595
Update README.md
Harishwar10 Oct 26, 2020
02b4380
Update README.md
Harishwar10 Oct 26, 2020
55122ff
Update README.md
Harishwar10 Oct 26, 2020
3ece213
Create 1to9_custom.c
Harishwar10 Oct 26, 2020
eff7a69
Create load.S
Harishwar10 Oct 26, 2020
9226b3a
Create sum1ton.c
Harishwar10 Oct 26, 2020
cbfe855
Update risc-v_solutions.tlv
Harishwar10 Oct 26, 2020
ddb2223
Update README.md
Harishwar10 Oct 26, 2020
8069a82
Update README.md
Harishwar10 Oct 26, 2020
75393ee
Update README.md
Harishwar10 Oct 26, 2020
b3d3c8c
Update README.md
Harishwar10 Oct 26, 2020
6a201d7
Delete simple.txt
Harishwar10 Oct 26, 2020
36c3a9c
Create README
Harishwar10 Oct 26, 2020
056b33e
Rename Day2/1to9_custom.c to Day1_2/1to9_custom.c
Harishwar10 Oct 26, 2020
8ac4de9
Rename Day2/load.S to Day1_2/load.S
Harishwar10 Oct 26, 2020
41ba841
Delete README
Harishwar10 Oct 26, 2020
1cf04f6
Rename Day2/sum1ton.c to Day1_2/sum1ton.c
Harishwar10 Oct 26, 2020
e67d309
Delete README.md
Harishwar10 Oct 26, 2020
c0550a1
Update README.md
Harishwar10 Oct 26, 2020
78a83ab
Update README.md
Harishwar10 Oct 26, 2020
d138687
Update README.md
Harishwar10 Oct 26, 2020
9f09313
Update README.md
Harishwar10 Oct 26, 2020
b00940d
Update README.md
Harishwar10 Oct 26, 2020
bd1e501
Update README.md
Harishwar10 Oct 26, 2020
59e1d80
Update README.md
Harishwar10 Oct 26, 2020
95ec695
Update README.md
Harishwar10 Oct 26, 2020
9407eb1
Add files via upload
Harishwar10 Oct 26, 2020
4cf8a02
Update README.md
Harishwar10 Oct 26, 2020
5d6d107
Update README.md
Harishwar10 Oct 26, 2020
771d8a0
Add files via upload
Harishwar10 Oct 26, 2020
6759f02
Update README.md
Harishwar10 Oct 26, 2020
750e737
Add files via upload
Harishwar10 Oct 26, 2020
14968de
Delete readme
Harishwar10 Oct 26, 2020
cc7fd40
Update README.md
Harishwar10 Oct 27, 2020
7e935a7
Update README.md
Harishwar10 Oct 27, 2020
5a9dda1
Update README.md
Harishwar10 Oct 27, 2020
61c5ac4
Update README.md
Harishwar10 Oct 27, 2020
6524d69
Update README.md
Harishwar10 Oct 27, 2020
76c4c1c
Update README.md
Harishwar10 Oct 27, 2020
770f9b9
Update README.md
Harishwar10 Oct 27, 2020
52dd9a0
Update README.md
Harishwar10 Oct 27, 2020
a0b7a99
Update README.md
Harishwar10 Oct 27, 2020
d8438d8
Update README.md
Harishwar10 Oct 27, 2020
9be2d86
Add files via upload
Harishwar10 Oct 27, 2020
e666300
Update README.md
Harishwar10 Oct 27, 2020
75cd524
Update README.md
Harishwar10 Oct 27, 2020
d74a5a0
Update README.md
Harishwar10 Oct 27, 2020
4efb343
Update README.md
Harishwar10 Oct 27, 2020
327bf34
Update README.md
Harishwar10 Oct 27, 2020
d533f30
Update README.md
Harishwar10 Oct 27, 2020
85c61fb
Update README.md
Harishwar10 Oct 27, 2020
9fbd4cd
Update README.md
Harishwar10 Oct 27, 2020
8ba01d3
Update README.md
Harishwar10 Oct 27, 2020
ed2cbfd
Update README.md
Harishwar10 Oct 27, 2020
b2c77a2
Update README.md
Harishwar10 Oct 27, 2020
3caa75a
Update README.md
Harishwar10 Oct 27, 2020
b72ba45
Update README.md
Harishwar10 Oct 27, 2020
d923fdb
Update README.md
Harishwar10 Oct 27, 2020
c628836
Update README.md
Harishwar10 Oct 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Day1_2/1to9_custom.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>

extern int load(int x, int y);

int main() {

int result = 0;
int count = 9;
result = load(0x0, count+1);
printf("Sum of number from 1 to %d is %d\n", count, result);
return 0;
}
14 changes: 14 additions & 0 deletions Day1_2/load.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.section .text
.global load
.type load, @function

load:
add a4, a0, zero // Initialize sum register a4 with 0x0
add a2, a0, a1 // store count of 10 in register a2. Register a1 is loaded with 0xa (decimal 10) from main program
add a3, a0, zero // initialize intermediate sum register a3 by 0
loop:
add a4, a3, a4 // Incremental addition
addi a3, a3, 1 // Increment intermediate register by 1
blt a3, a2, loop // If a3 is less than a2, branch to label named <loop>
add a0, a4, zero // Store final result to register a0 so that it can be read by main program
ret
11 changes: 11 additions & 0 deletions Day1_2/sum1ton.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include <stdio.h>

int main(){

int i, sum=0, n=9;
for(i=1;i<=n;i++)
sum = sum + i;
printf("Sum from 1 to %d is %d \n",n,sum);
return 0;

}
1 change: 0 additions & 1 deletion Day2/README.md

This file was deleted.

41 changes: 41 additions & 0 deletions Day3_5/Cycle_calculator
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
\m4_TLV_version 1d: tl-x.org
\SV

// =========================================
// Welcome! Try the tutorials via the menu.
// =========================================

// Default Makerchip TL-Verilog Code Template

// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m4_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
|calc
@1
$reset = *reset;


$val1[31:0] = >>2$out[31:0];
$val2[31:0] = $rand1[3:0];
$op[1:0] = $rand2[1:0];

$sum[31:0] = $val1[31:0] + $val2[31:0];
$diff[31:0] = $val1[31:0] - $val2[31:0];
$prod[31:0] = $val1[31:0] * $val2[31:0];
$quot[31:0] = $val1[31:0] / $val2[31:0];

$num = $reset ? 0 : >>1$num+1;
@2
$out[31:0] = ($reset|!$num) ? 32'b0 : (($op[1:0]==2'b00) ? $sum :
($op[1:0]==2'b01) ? $diff :
($op[1:0]==2'b10) ? $prod : $quot);




// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule
22 changes: 22 additions & 0 deletions Day3_5/Free_Running_oscillator
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
\m4_TLV_version 1d: tl-x.org
\SV

// =========================================
// Welcome! Try the tutorials via the menu.
// =========================================

// Default Makerchip TL-Verilog Code Template

// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m4_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
$reset = *reset;

$cnt[3:0] = $reset ? 0 : (>>1$cnt + 1);

// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule
8 changes: 0 additions & 8 deletions Day3_5/README.md

This file was deleted.

35 changes: 35 additions & 0 deletions Day3_5/Sequential_Calculator
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
\m4_TLV_version 1d: tl-x.org
\SV

// =========================================
// Welcome! Try the tutorials via the menu.
// =========================================

// Default Makerchip TL-Verilog Code Template

// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m4_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
$reset = *reset;

$val1[31:0] = >>1$out[31:0];
$val2[31:0] = $rand1[3:0];
$op[1:0] = $rand1[1:0];

$sum[31:0] = $val1[31:0] + $val2[31:0];
$diff[31:0] = $val1[31:0] - $val2[31:0];
$prod[31:0] = $val1[31:0] * $val2[31:0];
$quot[31:0] = $val1[31:0] / $val2[31:0];

$out[31:0] = $reset ? 32'b0 : ($op[1:0]==2'b00) ? $sum :
($op[1:0]==2'b01) ? $diff :
($op[1:0]==2'b10) ? $prod : $quot;



// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule
136 changes: 136 additions & 0 deletions Day3_5/calculator_solutions.tlv
Original file line number Diff line number Diff line change
@@ -1,3 +1,139 @@
\m4_TLV_version 1d: tl-x.org
\SV
//Calculator labs solutions here

\m4_TLV_version 1d: tl-x.org
\SV

// =========================================
// Welcome! Try the tutorials via the menu.
// =========================================

// Default Makerchip TL-Verilog Code Template

// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m4_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
$reset = *reset;
$op[1:0] = $sel[1:0];
$val1[31:0] = $rand1[3:0];
$val2[31:0] = $rand2[3:0];
$sum[31:0] = $val1[31:0] + $val2[31:0];
$diff[31:0] = $val1[31:0] - $val2[31:0];
$prod[31:0] = $val1[31:0] * $val2[31:0];
$quot[31:0] = $val1[31:0] / $val2[31:0];
$out[31:0] = ($op[1:0]==2'b00) ? $sum :
($op[1:0]==2'b01) ? $diff :
($op[1:0]==2'b10) ? $prod : $quot;

// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule


//cyclic_cal_with_validity

\m4_TLV_version 1d: tl-x.org
\SV

// =========================================
// Welcome! Try the tutorials via the menu.
// =========================================

// Default Makerchip TL-Verilog Code Template

// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m4_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
|calc
@0
$reset = *reset;
@1
$valid = $reset ? 0 : >>1$valid+1;
$valid_or_reset = $valid || $reset;
?$valid
@1
$val1[31:0] = >>2$out[31:0];
$val2[31:0] = $rand2[3:0];
$op[1:0] = $rand3[1:0];

$sum[31:0] = $val1[31:0] + $val2[31:0];
$diff[31:0] = $val1[31:0] - $val2[31:0];
$prod[31:0] = $val1[31:0] * $val2[31:0];
$quot[31:0] = $val1[31:0] / $val2[31:0];
@2
$out[31:0] = $valid_or_reset ? (($op[1:0]==2'b00) ? $sum :
($op[1:0]==2'b01) ? $diff :
($op[1:0]==2'b10) ? $prod : $quot) : >>1$out[31:0];

// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule


//with single memory

\m4_TLV_version 1d: tl-x.org
\SV

// =========================================
// Welcome! DAY3 LAB RISCV MYTH WORKSHOP
// =========================================

// Default Makerchip TL-Verilog Code Template

// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m4_include_lib(['https://raw.githubusercontent.com/stevehoover/RISC-V_MYTH_Workshop/bd1f186fde018ff9e3fd80597b7397a1c862cf15/tlv_lib/calculator_shell_lib.tlv'])

m4_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
//2 Cycle Calculator with Validity and Memory - A 2 stage pipelined Calculator for basic arithmetic with memory.
|calc
@0
$reset = *reset;
//1 bit COUNTER - for valid/invalid every alternate cycles.
$valid[0] = $reset ? 0 : (>>1$valid + 1);
$valid_reset = $valid || $reset;
?$valid_reset
@1
$val1[31:0] = >>2$out;
$val2[31:0] = $rand2[3:0];
//$op[1:0] = $rand3[1:0];
//Arithmetic Computations
$sum[31:0] = $val1 + $val2;
$sub[31:0] = $val1 - $val2;
$mul[31:0] = $val1 * $val2;
$div[31:0] = $val1 / $val2;
@2
//A mux to choose the desired operation
$out[31:0] = ($op[2:0] == 3'b000)
? $sum[31:0] :
($op[2:0] == 3'b001)
? $sub[31:0] :
($op[2:0] == 3'b010)
? $mul[31:0] :
($op[2:0] == 3'b011)
? $div[31:0] :
($op[2:0] == 3'b100)
? >>2$mem[31:0] :
0;
//MEMORY to hold previous value
$mem[31:0] = ($op[2:0] == 3'b100)
? >>2$mem[31:0] :
($op[2:0] == 3'b101)
? >>2$out[31:0] :
>>2$mem[31:0];

m4+cal_viz(@3)
// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 200;
*failed = 1'b0;
\SV
endmodule
Loading