feat: update test support for verilator

This commit is contained in:
maksyuki committed 2025-12-17 20:27:26 +08:00
1 parent 02415cf196
commit 25d77b42b6
5 files changed
+31 -17

No files matched your search

+9 -9
View File
@@ -9,20 +9,20 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Environment
run: python3 setup.py
- name: Run Tests
run: echo "No tests defined yet"
- name: Build Project
run: echo "Build placeholder"
- name: Compile Firmware
run: make CORE=MDD IP=MDD SIMU=VERILATOR HAVE_SRAM_IF=NO HAVE_SRAM_MACRO=NO HAVE_PLL=NO ISA=RV32IM EXEC_TYPE=ld2_psram firmware
- name: Build and Run sim
run: make CORE=MDD IP=MDD SIMU=VERILATOR HAVE_SRAM_IF=NO HAVE_SRAM_MACRO=NO HAVE_PLL=NO ISA=RV32IM EXEC_TYPE=ld2_psram sim
- name: Success Notification
run: echo "Workflow completed successfully"
+6 -5
View File
@@ -9,11 +9,12 @@ uint32_t my_get_millis(void) {
void main() {
uart0_init(CPU_FREQ, UART_BPS);
tinybooter();
i2c0_init((uint8_t)(CPU_FREQ / 2 - 1));
qspi_dev_init();
lcd_init();
app_info();
while(1);
// tinybooter();
// i2c0_init((uint8_t)(CPU_FREQ / 2 - 1));
// qspi_dev_init();
// lcd_init();
// lv_init();
// tim1_init();
+7 -1
View File
@@ -1,13 +1,19 @@
$(info RTL_PATH: $(RTL_PATH))
gen_mpw_code:
python3 $(RTL_PATH)/mpw/setup.py
ifeq ($(IP), MDD)
@echo "[mpw] generating user ip ..."
python3 $(RTL_PATH)/mpw/ip.py
python3 $(RTL_PATH)/mpw/core.py $(SIMU)
else
@echo "[mpw] skipping user ip generation"
endif
ifeq ($(CORE), MDD)
@echo "[mpw] generating core ..."
python3 $(RTL_PATH)/mpw/core.py $(SIMU)
else
@echo "[mpw] skipping core generation"
endif
include $(RTL_PATH)/script/software.mk
+1 -1
View File
@@ -64,7 +64,7 @@ comp: lint
$(MAKE) VM_PARALLEL_BUILDS=1 OPT_FAST="-O3" -C $(SOC_COMPILE_HOME) -f V$(SOC_VSRC_TOP).mk -j$(nproc) > $(BUILD_DIR)/compile.log 2>&1
sim: comp
$(BUILD_DIR)/emu -i .sw_build/retrosoc_fw.bin
$(BUILD_DIR)/emu -i .sw_build/retrosoc_fw.bin -t 360
# $(BUILD_DIR)/emu -t $(SOC_SIM_TIME) -i $(RTL_PATH)/.sw_build/retrosoc_fw.bin
# $(BUILD_DIR)/emu -i app/asm/hello-asm.bin
+8 -1
View File
@@ -205,7 +205,7 @@ def check_software_toolchain_installed():
result = run_command("riscv32-unknown-elf-gcc --version", check=False)
if result.returncode == 0:
version = result.stdout.strip()
print(f"✓ riscv32-unknown-elf-gcc version: {version}")
print(f"✓ {version}")
return True
else:
print("✗ riscv32-unknown-elf-gcc command exists but cannot get version info")
@@ -252,6 +252,8 @@ def main():
print("Verilator Installation Check Script")
print("=" * 60)
project_path = os.getcwd()
# Check current system
if not sys.platform.startswith('linux'):
print("Error: This script only works on Linux systems")
@@ -326,5 +328,10 @@ def main():
check_software_toolchain_installed()
# TODO: git clone mpw
os.chdir(project_path)
run_command("git clone https://github.com/retroSoC/mini-ver-mpw.git rtl/mini/mpw")
if __name__ == "__main__":
main()