Jesse Cirimelli-Low
01/24/2024, 8:50 PMTim Edwards
01/24/2024, 11:18 PMJesse Cirimelli-Low
01/24/2024, 11:26 PM/home/jcirimel/mpw3/clean/caravel/verilog/rtl/caravel.v:371: error: port ``sram_ro_clk'' is not a port of soc.
/home/jcirimel/mpw3/clean/caravel/verilog/rtl/caravel.v:371: error: port ``sram_ro_csb'' is not a port of soc.
/home/jcirimel/mpw3/clean/caravel/verilog/rtl/caravel.v:371: error: port ``sram_ro_addr'' is not a port of soc.
/home/jcirimel/mpw3/clean/caravel/verilog/rtl/caravel.v:371: error: port ``sram_ro_data'' is not a port of soc.
when I try to run an rtl simulation. I see some potentially relevant warnings in the mpw-3b repo for the core here https://github.com/efabless/caravel_mgmt_soc_litex/blob/mpw-3b/sram_roerrorsJesse Cirimelli-Low
01/24/2024, 11:28 PMJesse Cirimelli-Low
01/26/2024, 12:46 AMJesse Cirimelli-Low
01/26/2024, 12:52 AMTim Edwards
01/26/2024, 1:01 AMsram_ro_clk
and other signals indicate that the caravel/
repository, which is usually cloned from "caravel-lite", was still out of date, since the read-only 2nd port access to the SRAM was removed (because the SRAM was replaced with DFFRAM that doesn't have a 2nd port).
Feel free to post your C code and I can check for compatibility issues that I know about (but won't necessarily come to my mind without prompting).Jesse Cirimelli-Low
01/26/2024, 1:07 AMTim Edwards
01/26/2024, 1:15 AMMakefile
targets need to be updated. What you have is using -march=rv32imc
which might run some simple code but is going to fail if the compiler generates a compressed instruction or a hardware multiply, neither of which is supported on the VexRISC.
Compare the compile line from your Makefile:
${GCC_PATH}/${GCC_PREFIX}-gcc -I $(CARAVEL_PATH) -march=rv32imc -mabi=ilp32 -Wl,-Bstatic,-T,$(CARAVEL_FIRMWARE_PATH)/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(CARAVEL_FIRMWARE_PATH)/start.s $<
to the Makefile from the caravel_board repo `firmware/mpw2-5/blink/Makefile`:
$(TOOLCHAIN_PATH)$(TOOLCHAIN_PREFIX)-unknown-elf-gcc -I../ -I../generated/ -O0 -mabi=ilp32 -march=rv32i_zicsr -D__vexriscv__ -Wl,-Bstatic,-T,../sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ ../crt0_vex.S ../isr.c $<
There is also a significant difference between the startup code in crt0_vex.S
and start.s
.Tim Edwards
01/26/2024, 1:21 AMPWDD := $(shell pwd)
BLOCKS := $(shell basename $(PWDD))
# ---- Include Partitioned Makefiles ----
CONFIG = caravel_user_project
include $(MCW_ROOT)/verilog/dv/make/env.makefile
include $(MCW_ROOT)/verilog/dv/make/var.makefile
include $(MCW_ROOT)/verilog/dv/make/cpu.makefile
include $(MCW_ROOT)/verilog/dv/make/sim.makefile
and all the compiler stuff has been moved into one of those included files. But I'm not sure if that predates mpw-3 or not; $MCW_ROOT
points to caravel_mgmt_soc_litex
and if there is a directory there called verilog/dv/make/
then the Makefile style above applies; otherwise it doesn't.Jesse Cirimelli-Low
01/26/2024, 1:26 AMJesse Cirimelli-Low
01/26/2024, 3:02 AM$(GCC_PATH)/$(GCC_PREFIX)-gcc -I$(MCW_FIRMWARE_PATH)/ -I$(MCW_FIRMWARE_PATH)/../ -I$(MCW_FIRMWARE_PATH)/../generated/ -O0 -mabi=ilp32 -march=rv32i_zicsr -D__vexriscv__ -Wl,-Bstatic,-T,$(MCW_ROOT)/verilog/dv/firmware/sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ $(MCW_FIRMWARE_PATH)/crt0_vex.S $(MCW_FIRMWARE_PATH)/isr.c $<
should I be using caravel/mgmt_core_wrapper/verilog/dv/firmware/sections_vexriscv.lds instead of sections.lds?
they both look different than https://github.com/efabless/caravel_board/blob/main/firmware/mpw2-5/sections.ldsJesse Cirimelli-Low
01/26/2024, 3:06 AMTim Edwards
01/26/2024, 1:59 PMreg_spimaster_control
and reg_spimaster_status
.
But what error(s) are you getting now? You mentioned "things are going wrong before the flash starts executing". Is that still the case?Jesse Cirimelli-Low
01/26/2024, 7:44 PMTim Edwards
01/26/2024, 8:00 PMJesse Cirimelli-Low
01/26/2024, 8:09 PMTim Edwards
01/26/2024, 8:10 PMTim Edwards
01/26/2024, 8:11 PMJesse Cirimelli-Low
01/26/2024, 8:11 PMJesse Cirimelli-Low
01/26/2024, 8:11 PMTim Edwards
01/26/2024, 8:14 PMJesse Cirimelli-Low
01/26/2024, 8:17 PMTim Edwards
01/26/2024, 8:26 PMJesse Cirimelli-Low
01/26/2024, 8:26 PMJesse Cirimelli-Low
01/26/2024, 8:27 PM➜ caravel_user_project git:(mpw-3) ✗ diff ./caravel/verilog/dv/caravel/spiflash.v ./caravel/mgmt_core_wrapper/verilog/dv/vip/spiflash.v
68c68
< reg powered_up = 0;
---
> reg powered_up = 1;
110,112d109
< $display("Memory 5 bytes = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
< memory[1048576], memory[1048577], memory[1048578],
< memory[1048579], memory[1048580]);
114a112,114
> //$display("Memory 5 bytes = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
> // memory[0], memory[1], memory[2],
> // memory[3], memory[4]);
117,118c117,118
< memory[1048576], memory[1048577], memory[1048578],
< memory[1048579], memory[1048580]);
---
> memory[0], memory[1], memory[2],
> memory[3], memory[4]);
Tim Edwards
01/26/2024, 8:28 PMpowered_up = 0
vs. powered_up = 1
. . .Tim Edwards
01/26/2024, 8:29 PMJesse Cirimelli-Low
01/26/2024, 8:29 PMTim Edwards
01/26/2024, 8:30 PMJesse Cirimelli-Low
01/26/2024, 8:30 PMJesse Cirimelli-Low
01/26/2024, 8:44 PMJesse Cirimelli-Low
01/26/2024, 8:44 PMTim Edwards
01/26/2024, 8:45 PMJesse Cirimelli-Low
01/26/2024, 8:48 PMJesse Cirimelli-Low
01/26/2024, 8:49 PMJesse Cirimelli-Low
01/26/2024, 8:49 PMTim Edwards
01/26/2024, 8:49 PMJesse Cirimelli-Low
01/26/2024, 8:51 PMTim Edwards
01/26/2024, 8:52 PMJesse Cirimelli-Low
01/26/2024, 8:52 PMTim Edwards
01/26/2024, 8:54 PMJesse Cirimelli-Low
01/26/2024, 8:57 PMJesse Cirimelli-Low
01/30/2024, 2:51 AMJesse Cirimelli-Low
01/30/2024, 4:39 AMTim Edwards
01/30/2024, 2:01 PM