Skip to content

Commit

Permalink
Merge pull request #2 from ArvinDelavari/main
Browse files Browse the repository at this point in the history
AssembleX V3.0
  • Loading branch information
ArvinDelavari authored Aug 1, 2024
2 parents 05b9ad8 + 2be5c31 commit 2758895
Show file tree
Hide file tree
Showing 39 changed files with 1,488 additions and 1,462 deletions.
152 changes: 0 additions & 152 deletions AssembleX.py

This file was deleted.

32 changes: 32 additions & 0 deletions Assembly_Codes/fibonacci/fibonacci.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
main:
li sp, 0xffc
addi sp, sp, -48
sw s0, 44(sp)
addi s0, sp, 48
sw zero, -20(s0)
li a5, 1
sw a5, -24(s0)
li a5, 10
sw a5, -32(s0)
sw zero, -28(s0)
j .L2
.L3:
lw a4, -20(s0)
lw a5, -24(s0)
add a5, a4, a5
sw a5, -36(s0)
lw a5, -24(s0)
sw a5, -20(s0)
lw a5, -36(s0)
sw a5, -24(s0)
lw a5, -28(s0)
addi a5, a5, 1
sw a5, -28(s0)
.L2:
lw a4, -28(s0)
lw a5, -32(s0)
blt a4, a5, .L3
li a5, 0
mv a0, a5
lw s0, 44(sp)
addi sp, sp, 48
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
00000137
00001137
ffc10113
fd010113
04812c23
02812623
03010413
fc042ca3
fe042623
000007b7
fcf428a3
00178793
fef42423
000007b7
fcf420a3
fc0424a3
00a78793
fef42023
fe042223
0300006f
fec42703
fe842783
00f707b3
faf42ca3
fcf42e23
fe842783
fcf42ca3
fef42623
fdc42783
fcf428a3
fef42423
fe442783
00178793
fcf424a3
fef42223
fe442703
fe042783
fcf746e3
000007b7
00078793
00078513
02c12403
03010113
Expand Down
9 changes: 9 additions & 0 deletions Assembly_Codes/multiplication/multiplication.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
addi x1, x0, 0x07f9

addi x12, x0, 25
addi x13, x0, 12

mul x14, x12, x13
addi x2, x0, 0x07f9

ebreak
7 changes: 7 additions & 0 deletions Assembly_Codes/multiplication/multiplication_firmware.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
7f900093
01900613
00c00693
02d60733
7f900113
00100073
00100073
9 changes: 9 additions & 0 deletions Assembly_Codes/sum1to100/sum1to100.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
addi x12, x0, 101
add x13, x0, x0
add x14, x0, x0
LOOP:
add x14, x13, x14
addi x13, x13, 1
blt x13, x12, LOOP
sw x14, 100(x0)
ebreak
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
00e68733
00168693
fec6cce3
0ce02423
00100073
06e02223
00100073
43 changes: 15 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
![License](https://img.shields.io/github/license/phoeniX-Digital-Design/AssembleX?color=dark-green)
![Test](https://img.shields.io/badge/tests-passed-dark_green)
![Integration with phoeniX project](https://img.shields.io/badge/integration_with_phoeniX-in_progress-blue)
![RV32](https://img.shields.io/badge/integration_with_phoeniX-IM-blue)

AssembleX V2.0
AssembleX V3.0
===============

<div align="justify">

This repository contains full Python source codes of `AssembleX`, the assembly code executant software for [phoeniX RISC-V processor](https://github.com/phoeniX-Digital-Design/phoeniX) which is written in Verilog, at Electronics Research Center of Iran University of Science and Technology. AssembleX is now working with the help of [riscv-assembler](https://github.com/celebi-pkg/riscv-assembler) software.
This repository contains source codes of `AssembleX`, the assembly code executant software for the [phoeniX RISC-V processor](https://github.com/phoeniX-Digital-Design/phoeniX) which is implemented in Verilog, at Electronics Research Center of Iran University of Science and Technology. AssembleX is powered by [riscv-assembler](https://github.com/celebi-pkg/riscv-assembler) and [PQR5ASM](https://github.com/iammituraj/pqr5asm) open-source projects. Current version of AssembleX supports `RV32IM` extenstions of standard RISC-V ISA.

AssembleX repository contains an open source software under the [GNU V3.0 license](https://en.wikipedia.org/wiki/GNU_General_Public_License) and is free to use.
This repository contains an open source software under the [GNU V3.0 license](https://en.wikipedia.org/wiki/GNU_General_Public_License) and is free to use.

- Contact phoeniX Team : phoeniX.Digital.Electronics@gmail.com
- Contact Us: phoeniX.Digital.Electronics@gmail.com
- Iran University of Science and Technology - Electronics Research Center
- Digital Design Research Lab, SCaN Research Lab - Fall 2023
- Digital Design Research Lab, SCaN Research Lab - Summer 2024

</div>

### Running Sample Codes
### How to use AssembleX
<div align="justify">

Before running the script, note that the assembly code must be saved in the project directory with the same name.
To run any of these sample projects simply run python `AssembleX.py sample` followed by the name of the project passed as a variable named project to the Python script.
The input command format for the terminal follows the structure illustrated below:
In order to run your own code on phoeniX, create a directory named to your project such as `/my_project` in `/Assembly_Codes/`. Put all your `user_code.s` files in my_project and run the following command from the main directory:
```
python AssembleX.py sample {project_name}
```
For example:
```
python AssembleX.py sample fibonacci
```
After execution of this script, firmware file will be generated and this final file can be directly fed to our Verilog testbench. AssembleX automatically runs the testbench and calls upon gtkwave to display the selected signals in the waveform viewer application, gtkwave.
</div>

### Running Your Own Code
<div align="justify">

In order to run your own code on phoeniX, create a directory named to your project such as `/my_project` in `/Software/User_Codes/`. Put all your ``user_code.s` files in my_project and run the following command from the main directory:
```
python AssembleX.py code my_project
python AssembleX.py my_project_directory/my_project.s
```
Provided that you name your project sub-directory correctly the AssembleX software will create `my_project_firmware.hex` and fed it directly to the testbench of phoeniX processor. After that, iverilog and GTKWave are used to compile the design and view the selected waveforms.

</div>

<div align="justify">
> [!NOTE]\
> AssembleX V3.0 is not integrated within the [phoeniX](https://github.com/phoeniX-Digital-Design/phoeniX) project repository yet. Currently phoeniX core is working with AssembleX V1.0 which is using the assistance of Venus Simulator VS code extension. **phoeniX** RISC-V processor will be empowered by **AssembleX V3.0** in the upcoming updates very soon!

> [!NOTE]\
> AssembleX V2.0 is not integrated within the [phoeniX](https://github.com/phoeniX-Digital-Design/phoeniX) project repository yet. Currently phoeniX core is working with AssembleX V1.0 which is using the assistance of Venus Simulator VS code extension. **phoeniX** RISC-V processor will be empowered by **AssembleX V2.0** in the upcoming updates very soon!
> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
</div>
Copyright 2024 Iran University of Science and Technology. <phoenix.digital.electronics@gmail.com>
36 changes: 0 additions & 36 deletions Sample_Assembly_Codes/binary_search/binary_search.s

This file was deleted.

18 changes: 0 additions & 18 deletions Sample_Assembly_Codes/binary_search/binary_search_firmware.hex

This file was deleted.

Loading

0 comments on commit 2758895

Please sign in to comment.