Skip to content

This repository is for students to go through the Learning Journey for CHISEL and Funcitonal Programming with SCALA also perform tasks related to it.

Notifications You must be signed in to change notification settings

SSaadAKHTAR/Scala-Chisel-Learning-Journey

 
 

Repository files navigation

Scala Chisel Learning Journey

Join the chat at https://gitter.im/merledu/scala-chisel-learning-journey

Start by setting up the working enviroment

Dependencies

JDK 8 or newer

sudo apt-get install openjdk-11-jdk
sudo apt-get install openjdk-11-jre

SBT

SBT is the most common built tool in the Scala community. You can download it here.

VERILATOR

sudo apt-get install verilator

How to get started

Fork this repository on your own individual profiles. After forking clone the repository and run:

sbt test

You should see a whole bunch of output that ends with something like the following lines

[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 5 s, completed Dec 16, 2020 12:18:44 PM

If you see the above then...

It worked!

You are ready to go. Next step is to go inside the docs/ folder where you will find the labs to perform.

For quick debugging

If you quickly want to see what verilog is being generated, go to this link https://bit.ly/3u3zr0e and write Chisel here.

Test cases

Program 1

addi x5 x0 0
addi x6 x0 5
add x8 x6 x5
LOOP:
addi x5 x5 1
sw x5 100(x0)
beq x5 x6 ANS
jal LOOP
ANS: lw x7 100(x0)

Program 2

addi x5 x0 3
LOOP:
addi x5 x5 1
addi x6 x0 7
sw x6 100(x5)
lw x7 100(x5)
bne x5 x7 LOOP

Program 3

addi x5 x0 0
addi x7 x0 1
addi x6 x0 10
addi x28 x0 0
LOOP: beq x28 x6 END
add x29 x5 x7
add x5 x0 x7
add x7 x0 x29
jal LOOP
END:

Fibonacci Series:

addi x1,x0,0
addi x2,x0,1
addi x10,x0,4
addi x6,x0,40
addi x3,x0,0
addi x4,x3,4
sw x1,0x100(x3)
sw x2,0x100(x4)
addi x14,x0,8
addi x5,x0,8
addi x13,x0,8
addi x15,x0,4
addi x9,x0,4
add x8,x1,x2
up:
beq x5,x6,end
add x12,x0,x8
sw x12,0x100(x5)
lw x11,0x100(x9)
add x8,x11,x8
addi x5,x5,4
addi x9,x9,4
jal x7,up
end:
beq x3,x6,break
lw x16,0x100(x3)
addi x3,x3,4
jal x7,end
break:

About

This repository is for students to go through the Learning Journey for CHISEL and Funcitonal Programming with SCALA also perform tasks related to it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 80.7%
  • Scala 18.5%
  • JavaScript 0.8%