Skip to content

Commit

Permalink
Merge V0.2 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
FarazGhoreishy committed Dec 30, 2023
2 parents cb57918 + 7bc42c0 commit da417dc
Show file tree
Hide file tree
Showing 47 changed files with 3,047,136 additions and 35,314 deletions.
23 changes: 12 additions & 11 deletions AssembleX.py → AssembleX_V1.0.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# ----------------------------------------------------------------
# | AssembleX |
# | AssembleX V0.1 |
# | ------------------------------------------------------------ |
# | Custom-built RISC-V assembly code executant for phoeniX core |
# | By : Arvin Delavari - Faraz Ghoreishy |
# | Iran University of Science and Technology - Summer 2023 |
# ----------------------------------------------------------------

import os
import sys
import glob
Expand Down Expand Up @@ -61,14 +62,14 @@
# OS : cmd commands to execute Verilog simulations:
os.system("iverilog -IModules -o phoeniX.vvp phoeniX_Testbench.v")
os.system("vvp phoeniX.vvp")
with open(testbench_file, 'w') as file:
for line in lines:
# Change testbench file
if line.startswith("\t`define FIRMWARE"):
print("Line found!")
# Remove firmware file address
modified_line = line.replace(line,'\t`define FIRMWARE\n')
file.write(modified_line)
else:
file.write(line)
# with open(testbench_file, 'w') as file:
# for line in lines:
# # Change testbench file
# if line.startswith("\t`define FIRMWARE"):
# print("Line found!")
# # Remove firmware file address
# modified_line = line.replace(line,'\t`define FIRMWARE\n')
# file.write(modified_line)
# else:
# file.write(line)
os.system("gtkwave phoeniX.gtkw")
Binary file modified Documents/RISCV_Original_Documents/riscv-privileged-20211203.pdf
Binary file not shown.
Binary file added Documents/RISCV_Original_Documents/riscvcard.pdf
Binary file not shown.
Binary file not shown.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CORE_TESTBENCH = $(CORE_NAME)_Testbench.v
TOOLCHAIN_PREFIX = riscv64-unknown-elf-

MABI = ilp32
MARCH = rv32i
MARCH = rv32im

CFLAGS = -mabi=$(MABI) -march=$(MARCH)
CFLAG_LINKING = -Wl,--gc-sections
Expand Down Expand Up @@ -48,7 +48,7 @@ firmware.hex: start.elf firmware.elf

firmware.elf: $(OBJECT_C) $(OBJECT_S)
$(TOOLCHAIN_PREFIX)gcc -c $(CFLAGS) -o $(PROJECT_DIR)/syscalls.o $(FIRMWARE_DIR)/syscalls.c
$(TOOLCHAIN_PREFIX)gcc $(CFLAGS) $(CFLAG_LINKING) -o $(PROJECT_DIR)/$(project)_firmware.elf $< $(PROJECT_DIR)/syscalls.o -T $(FIRMWARE_DIR)/riscv.ld -lstdc++
$(TOOLCHAIN_PREFIX)gcc $(CFLAGS) $(CFLAG_LINKING) -o $(PROJECT_DIR)/$(project)_firmware.elf $^ $(PROJECT_DIR)/syscalls.o -T $(FIRMWARE_DIR)/riscv.ld -lstdc++
$(TOOLCHAIN_PREFIX)objdump -d $(PROJECT_DIR)/$(project)_firmware.elf > $(PROJECT_DIR)/$(project)_firmware.txt
$(TOOLCHAIN_PREFIX)objcopy -O verilog $(PROJECT_DIR)/$(project)_firmware.elf $(PROJECT_DIR)/firmware.tmp

Expand All @@ -57,10 +57,11 @@ start.elf:
$(TOOLCHAIN_PREFIX)objcopy -O verilog $(PROJECT_DIR)/$(project)_start.elf $(PROJECT_DIR)/start.tmp

$(OBJECT_C): $(SOURCE_C)
@echo "Hello are you there?"
@echo "Compiling C files"
$(TOOLCHAIN_PREFIX)gcc -c $(CFLAGS) -o $@ $<

$(OBJECT_S): $(SOURCE_S)
@echo "Compiling ASM files"
$(TOOLCHAIN_PREFIX)gcc -c $(CFLAGS) -o $@ $<

%::
Expand Down
Loading

0 comments on commit da417dc

Please sign in to comment.