-
Notifications
You must be signed in to change notification settings - Fork 82
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
9 changed files
with
66 additions
and
20 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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
pacman -S jdk-openjdk git gcc make cmake pkg-config glfw riscv64-linux-gnu-gcc | ||
pacman -S jdk-openjdk git gcc make cmake pkg-config glfw riscv64-linux-gnu-gcc python3 |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sudo apt install default-jre default-jdk git gcc g++ make cmake pkg-config uuid uuid-dev libglfw3 libglfw3-dev gcc-riscv64-linux-gnu | ||
sudo apt install default-jre default-jdk git gcc g++ make cmake pkg-config uuid uuid-dev libglfw3 libglfw3-dev gcc-riscv64-linux-gnu python3 | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
sudo dnf install -y git gcc g++ make cmake pkg-config uuid uuid-devel java-11-openjdk-devel iverilog glfw glfw-devel gcc-riscv64-linux-gnu perl-FindBin | ||
sudo dnf install -y git gcc g++ make cmake pkg-config uuid uuid-devel java-11-openjdk-devel iverilog glfw glfw-devel gcc-riscv64-linux-gnu perl-FindBin python3 |
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,15 @@ | ||
|
||
M_icev_cpu.v: export.si | ||
# export the controller to verilog | ||
silice export.si --output M_icev_cpu.v \ | ||
--export icev_cpu \ | ||
--frameworks_dir ../../../frameworks/ \ | ||
--framework ../../../frameworks/boards/bare/bare.v | ||
-D ICE40=1 \ | ||
-D ICESTICK=1 \ | ||
-D MEM_ADDR_SIGNED=0 \ | ||
# clean up compiler log files | ||
rm *.log *.lpp | ||
|
||
clean: | ||
rm -rf build.* M_icev_cpu.* *.lpp abc.history |
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 @@ | ||
// CPU configuration | ||
// -> memory address bus width | ||
$$addrW = 12 | ||
// -> memory interface | ||
group bram_io | ||
{ | ||
uint4 wenable(0), | ||
uint32 wdata(0), | ||
uint32 rdata(0), | ||
uint$addrW$ addr(0), // boot address | ||
} | ||
// include the CPU | ||
$include('../CPUs/ice-v.si') | ||
// wrapper to avoid manual configuration of the Silice interface | ||
unit icev_cpu( | ||
output! uint4 wenable(0), | ||
// ^ no register | ||
output! uint32 wdata(0), | ||
input uint32 rdata(0), | ||
output! uint$addrW$ addr(0), // boot address | ||
) { | ||
// instantiates the group for IO | ||
bram_io mem_io; | ||
// instantiates the CPU | ||
rv32i_cpu cpu( mem <:> mem_io ); | ||
// bind | ||
always { | ||
wenable = mem_io.wenable; // cpu wants to write | ||
wdata = mem_io.wdata; // data cpu wants to write | ||
addr = mem_io.addr; // address cpu wants to access | ||
mem_io.rdata = rdata; // data received from memory | ||
} | ||
} |