Browse Source

sdram: fix 8-bit ports; rename fw/ to rv32/ to avoid confusion

Fix bug that caused data input to get lost for an 8-bit port.

The fw/ directory is too easy to confuse with the name of the git tree
itself; furthermore there should be esp32 firmware added at some
point. Rename it to rv32/.
H. Peter Anvin 3 years ago
parent
commit
ac8a492ba2
71 changed files with 9 additions and 9 deletions
  1. 1 1
      Makefile
  2. 1 1
      fpga/Makefile
  3. 3 3
      fpga/ip/fastmem_ip.v
  4. 1 1
      fpga/max80.qsf
  5. 1 1
      fpga/max80.sv
  6. 1 1
      fpga/max80jic.cof
  7. BIN
      fpga/output_files/max80.jbc
  8. BIN
      fpga/output_files/max80.jic
  9. BIN
      fpga/output_files/max80.pof
  10. BIN
      fpga/output_files/max80.sof
  11. 1 1
      fpga/sdram.sv
  12. 0 0
      rv32/.gitignore
  13. 0 0
      rv32/Makefile
  14. 0 0
      rv32/abcdisk.c
  15. 0 0
      rv32/abcdrive.c
  16. 0 0
      rv32/abcio.c
  17. 0 0
      rv32/abcio.h
  18. 0 0
      rv32/abcmem.c
  19. 0 0
      rv32/abcrtc.c
  20. 0 0
      rv32/bin2mif.pl
  21. 0 0
      rv32/boot.mif
  22. 0 0
      rv32/console.c
  23. 0 0
      rv32/console.h
  24. 0 0
      rv32/die.c
  25. 0 0
      rv32/diskcache.c
  26. 0 0
      rv32/dummy.c
  27. 0 0
      rv32/fatfs/LICENSE.txt
  28. 0 0
      rv32/fatfs/orig/README
  29. 0 0
      rv32/fatfs/orig/diskio.c
  30. 0 0
      rv32/fatfs/orig/ff.c
  31. 0 0
      rv32/fatfs/orig/ff.h
  32. 0 0
      rv32/fatfs/orig/ffconf.h
  33. 0 0
      rv32/fatfs/orig/ffunicode.c
  34. 0 0
      rv32/fatfs/source/00history.txt
  35. 0 0
      rv32/fatfs/source/00readme.txt
  36. 0 0
      rv32/fatfs/source/diskio.h
  37. 0 0
      rv32/fatfs/source/ff.c
  38. 0 0
      rv32/fatfs/source/ff.h
  39. 0 0
      rv32/fatfs/source/ffconf.h
  40. 0 0
      rv32/fatfs/source/ffsystem.c
  41. 0 0
      rv32/fatfs/source/ffunicode.c
  42. 0 0
      rv32/fatfs/version.txt
  43. 0 0
      rv32/fw.h
  44. 0 0
      rv32/head.S
  45. 0 0
      rv32/include/compiler.h
  46. 0 0
      rv32/io.h
  47. 0 0
      rv32/ioregs.h
  48. 0 0
      rv32/irq.h
  49. 0 0
      rv32/irqasm.S
  50. 0 0
      rv32/list.h
  51. 0 0
      rv32/main.c
  52. 0 0
      rv32/max80.ld
  53. 0 0
      rv32/memcpy.S
  54. 0 0
      rv32/memset.c
  55. 0 0
      rv32/picorv32.h
  56. 0 0
      rv32/rom.S
  57. 0 0
      rv32/romcopy.c
  58. 0 0
      rv32/roms/ufddos80.rom
  59. 0 0
      rv32/rtc.c
  60. 0 0
      rv32/runtest.c
  61. 0 0
      rv32/sbrk.c
  62. 0 0
      rv32/sdcard.c
  63. 0 0
      rv32/sdcard.h
  64. 0 0
      rv32/start_test.S
  65. 0 0
      rv32/sys.h
  66. 0 0
      rv32/system.c
  67. 0 0
      rv32/systime.h
  68. 0 0
      rv32/test/main.c
  69. 0 0
      rv32/test/system.c
  70. 0 0
      rv32/testdata.S
  71. 0 0
      rv32/testimg.S

+ 1 - 1
Makefile

@@ -1,4 +1,4 @@
-SUBDIRS = tools fw fpga
+SUBDIRS = tools rv32 fpga
 
 all clean spotless :
 	$(MAKE) local.$@ $(SUBDIRS) goal=$@

+ 1 - 1
fpga/Makefile

@@ -52,7 +52,7 @@ $(outdir)/%.pow.rpt: $(outdir)/%.sta.rpt
 	$(QPOW) $*
 
 # XXX: do all .sof -> conversions using quartus_cpf
-$(outdir)/%.jic:  %jic.cof $(outdir)/%.sof ../fw/dram.hex
+$(outdir)/%.jic:  %jic.cof $(outdir)/%.sof ../rv32/dram.hex
 	$(QCPF) --convert $<
 
 # Clean out SignalTap

+ 3 - 3
fpga/ip/fastmem_ip.v

@@ -97,7 +97,7 @@ module fastmem_ip (
 		altsyncram_component.byte_size = 8,
 		altsyncram_component.clock_enable_input_a = "BYPASS",
 		altsyncram_component.clock_enable_output_a = "BYPASS",
-		altsyncram_component.init_file = "../fw/boot.mif",
+		altsyncram_component.init_file = "../rv32/boot.mif",
 		altsyncram_component.intended_device_family = "Cyclone IV E",
 		altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO",
 		altsyncram_component.lpm_type = "altsyncram",
@@ -136,7 +136,7 @@ endmodule
 // Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
 // Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
 // Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
-// Retrieval info: PRIVATE: MIFfilename STRING "../fw/boot.mif"
+// Retrieval info: PRIVATE: MIFfilename STRING "../rv32/boot.mif"
 // Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "8192"
 // Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
 // Retrieval info: PRIVATE: READ_DURING_WRITE_MODE_PORT_A NUMERIC "2"
@@ -154,7 +154,7 @@ endmodule
 // Retrieval info: CONSTANT: BYTE_SIZE NUMERIC "8"
 // Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
 // Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
-// Retrieval info: CONSTANT: INIT_FILE STRING "../fw/boot.mif"
+// Retrieval info: CONSTANT: INIT_FILE STRING "../rv32/boot.mif"
 // Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
 // Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
 // Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"

+ 1 - 1
fpga/max80.qsf

@@ -275,7 +275,7 @@ set_global_assignment -name SYSTEMVERILOG_FILE abcbus.sv
 set_global_assignment -name VERILOG_FILE ip/abcmapram.v
 set_global_assignment -name VERILOG_FILE ip/fastmem_ip.v
 set_global_assignment -name SYSTEMVERILOG_FILE fast_mem.sv
-set_global_assignment -name MIF_FILE ../fw/boot.mif
+set_global_assignment -name MIF_FILE ../rv32/boot.mif
 set_global_assignment -name VERILOG_FILE picorv32.v
 set_global_assignment -name SYSTEMVERILOG_FILE functions.sv
 set_global_assignment -name SYSTEMVERILOG_FILE spi_master.sv

+ 1 - 1
fpga/max80.sv

@@ -494,7 +494,7 @@ module max80 (
    //
    wire [31:0] fast_mem_rdata;
 
-   fast_mem // #(.bits(cpu_fast_mem_bits), .mif("../fw/boot"))
+   fast_mem // #(.bits(cpu_fast_mem_bits), .mif("../rv32/boot"))
    fast_mem(
 	    .rst_n ( rst_n ),
 	    .clk   ( sys_clk ),

+ 1 - 1
fpga/max80jic.cof

@@ -14,7 +14,7 @@
 		</bit0>
 	</sof_data>
 	<hex_block>
-		<hex_filename>../fw/dram.hex</hex_filename>
+		<hex_filename>../rv32/dram.hex</hex_filename>
 		<hex_addressing>relative</hex_addressing>
 		<hex_offset>1048576</hex_offset>
 		<hex_little_endian>0</hex_little_endian>

BIN
fpga/output_files/max80.jbc


BIN
fpga/output_files/max80.jic


BIN
fpga/output_files/max80.pof


BIN
fpga/output_files/max80.sof


+ 1 - 1
fpga/sdram.sv

@@ -150,7 +150,7 @@ module dram_port
 
    genvar i;
    generate
-      for (i = 0; i < (width >> 4); i++)
+      for (i = 0; i < ((width + 15) >> 4); i++)
 	begin : w
 	   always @(posedge bus.clk)
 	     if (started & ~ready & bus.rstrb[i])

+ 0 - 0
fw/.gitignore → rv32/.gitignore


+ 0 - 0
fw/Makefile → rv32/Makefile


+ 0 - 0
fw/abcdisk.c → rv32/abcdisk.c


+ 0 - 0
fw/abcdrive.c → rv32/abcdrive.c


+ 0 - 0
fw/abcio.c → rv32/abcio.c


+ 0 - 0
fw/abcio.h → rv32/abcio.h


+ 0 - 0
fw/abcmem.c → rv32/abcmem.c


+ 0 - 0
fw/abcrtc.c → rv32/abcrtc.c


+ 0 - 0
fw/bin2mif.pl → rv32/bin2mif.pl


+ 0 - 0
fw/boot.mif → rv32/boot.mif


+ 0 - 0
fw/console.c → rv32/console.c


+ 0 - 0
fw/console.h → rv32/console.h


+ 0 - 0
fw/die.c → rv32/die.c


+ 0 - 0
fw/diskcache.c → rv32/diskcache.c


+ 0 - 0
fw/dummy.c → rv32/dummy.c


+ 0 - 0
fw/fatfs/LICENSE.txt → rv32/fatfs/LICENSE.txt


+ 0 - 0
fw/fatfs/orig/README → rv32/fatfs/orig/README


+ 0 - 0
fw/fatfs/orig/diskio.c → rv32/fatfs/orig/diskio.c


+ 0 - 0
fw/fatfs/orig/ff.c → rv32/fatfs/orig/ff.c


+ 0 - 0
fw/fatfs/orig/ff.h → rv32/fatfs/orig/ff.h


+ 0 - 0
fw/fatfs/orig/ffconf.h → rv32/fatfs/orig/ffconf.h


+ 0 - 0
fw/fatfs/orig/ffunicode.c → rv32/fatfs/orig/ffunicode.c


+ 0 - 0
fw/fatfs/source/00history.txt → rv32/fatfs/source/00history.txt


+ 0 - 0
fw/fatfs/source/00readme.txt → rv32/fatfs/source/00readme.txt


+ 0 - 0
fw/fatfs/source/diskio.h → rv32/fatfs/source/diskio.h


+ 0 - 0
fw/fatfs/source/ff.c → rv32/fatfs/source/ff.c


+ 0 - 0
fw/fatfs/source/ff.h → rv32/fatfs/source/ff.h


+ 0 - 0
fw/fatfs/source/ffconf.h → rv32/fatfs/source/ffconf.h


+ 0 - 0
fw/fatfs/source/ffsystem.c → rv32/fatfs/source/ffsystem.c


+ 0 - 0
fw/fatfs/source/ffunicode.c → rv32/fatfs/source/ffunicode.c


+ 0 - 0
fw/fatfs/version.txt → rv32/fatfs/version.txt


+ 0 - 0
fw/fw.h → rv32/fw.h


+ 0 - 0
fw/head.S → rv32/head.S


+ 0 - 0
fw/include/compiler.h → rv32/include/compiler.h


+ 0 - 0
fw/io.h → rv32/io.h


+ 0 - 0
fw/ioregs.h → rv32/ioregs.h


+ 0 - 0
fw/irq.h → rv32/irq.h


+ 0 - 0
fw/irqasm.S → rv32/irqasm.S


+ 0 - 0
fw/list.h → rv32/list.h


+ 0 - 0
fw/main.c → rv32/main.c


+ 0 - 0
fw/max80.ld → rv32/max80.ld


+ 0 - 0
fw/memcpy.S → rv32/memcpy.S


+ 0 - 0
fw/memset.c → rv32/memset.c


+ 0 - 0
fw/picorv32.h → rv32/picorv32.h


+ 0 - 0
fw/rom.S → rv32/rom.S


+ 0 - 0
fw/romcopy.c → rv32/romcopy.c


+ 0 - 0
fw/roms/ufddos80.rom → rv32/roms/ufddos80.rom


+ 0 - 0
fw/rtc.c → rv32/rtc.c


+ 0 - 0
fw/runtest.c → rv32/runtest.c


+ 0 - 0
fw/sbrk.c → rv32/sbrk.c


+ 0 - 0
fw/sdcard.c → rv32/sdcard.c


+ 0 - 0
fw/sdcard.h → rv32/sdcard.h


+ 0 - 0
fw/start_test.S → rv32/start_test.S


+ 0 - 0
fw/sys.h → rv32/sys.h


+ 0 - 0
fw/system.c → rv32/system.c


+ 0 - 0
fw/systime.h → rv32/systime.h


+ 0 - 0
fw/test/main.c → rv32/test/main.c


+ 0 - 0
fw/test/system.c → rv32/test/system.c


+ 0 - 0
fw/testdata.S → rv32/testdata.S


+ 0 - 0
fw/testimg.S → rv32/testimg.S