Commit Graph

96 Commits

Author SHA1 Message Date
Byron Lathi
642dfcbeb1 change to asynchronous read 2022-12-29 11:51:07 -05:00
Byron Lathi
34afd3875c Add timer and testbench 2022-12-29 11:14:32 -05:00
Byron Lathi
91833e1f4f Test the runram program 2022-12-23 14:35:45 -05:00
Byron Lathi
33e33231a7 Add test programs 2022-12-23 14:20:44 -05:00
Byron Lathi
9947fbdfe2 Start work on simpler board 2022-12-23 10:34:47 -05:00
Byron Lathi
6361f39e0b Add back in DM signals for proper byte accesses 2022-12-22 23:26:01 -05:00
Byron Lathi
e08e839d01 New test program 2022-12-22 22:39:43 -05:00
Byron Lathi
cf9aef64ac First stab at getting sdram working 2022-12-22 20:25:32 -05:00
Byron Lathi
772f8ff13f Update gitignore 2022-12-21 20:49:27 -05:00
Byron Lathi
df80fe0803 throw some stuff on.
This will have to be changed, some things like the VGA connector will
not work because they will interfere with the cpu adapter.

It may be worth thinking about making these smaller and not including
the ethernet for example, since that will not come for a while.

The only things we really need to start are the SD card and serial port.
2022-12-21 19:13:00 -05:00
Byron Lathi
b8161e3082 Add LED module and address decoding; disable LA
The Logic analyzer isn't that useful anyway since it does not track
rising and falling edges.
2022-12-20 19:26:24 -05:00
Byron Lathi
aefa3d23f3 remove dangling comma 2022-12-20 17:33:58 -05:00
Byron Lathi
12fb6283cc Get block rom working 2022-12-20 17:26:59 -05:00
Byron Lathi
52de8d3eb3 Get block rom kind of working 2022-12-20 15:38:55 -05:00
Byron Lathi
19b13164e9 RWB and ADDR are inputs, not outputs! 2022-12-19 23:43:45 -05:00
Byron Lathi
507d783a0c remove lock 2022-12-19 23:15:12 -05:00
Byron Lathi
4061afcce2 Update gitignore 2022-12-19 23:13:33 -05:00
Byron Lathi
09e31fe7ab Start over pretty much. 2022-12-19 23:12:22 -05:00
Byron Lathi
3a70c4f523 Ignore gerbers 2022-10-12 18:52:12 -05:00
Byron Lathi
44b324a768 Change drill output folder 2022-10-12 18:51:40 -05:00
Byron Lathi
7341973620 Redo shield, removing FPGA
Don't have the FPGA on the shield, just have it be a board that plugs
into the FPGA.

Don't mind the component and footprint choices yet, I still need to
figure out exactly which parts to use.
2022-10-12 18:50:42 -05:00
Byron Lathi
0256a85acc Create Efinix Adapter
Split the project into two parts, the adapter will connect the cpu
directly to the FPGA, and the shield will house all of the peripherals.

I will get the adapter first so that I can get things like sdram
working first, and then make the shield with things like SD card, USB,
maybe even ethernet and VGA. Basically anthing since it's connected to
an FPGA.
2022-10-12 18:01:58 -05:00
Byron Lathi
6e650e627f Change CI to ignore fpga build, kicad to symlink
Did not automate tests with efinix yet.
2022-10-04 17:25:42 -05:00
Byron Lathi
fcae23785e Throw everything up
I think that previously, I had not actually commited any of this to git.
This adds all of the new effinix stuff that I had been working on for
months.

The gist of all of this is that the intel fpga is expensive and does not
exist, whereas the effinix ones are not as expensive and more existant.
This redoes the project to use the dev board, as well as a custom board
that I may or may not make.
2022-10-04 17:15:49 -05:00
Byron Lathi
a836643807 Disable in system memory editor for ROM
Now that the ROM is just a bootloader and the kernel is stored on the SD
card, we do not need to be constantly changing the ROM.

Disabling the memory editor dramatically reduces compilation time which
will be useful when implementing FPGA features in the future.
2022-04-19 14:47:19 -05:00
Byron Lathi
ff8078fac7 Program ROM with bootloader
Replaces the ROM image with the bootloader instead of bootrom, which no
longer exists.
2022-04-19 13:46:57 -05:00
Byron Lathi
ee95a592cd Reset bit count upon entering RXDATA
The but count should be set to 7 when entering RXDATA. previously it was
not reset or left at 0, which caused the first byte to only have the lsb
set and all other bits to be read incorrectly.
2022-04-14 11:20:48 -05:00
Byron Lathi
3a59de2947 Change data count to have proper width (9)
This was probably an off-by-one mistage, with the width set to 10
instead of 9. The width should be 9 since the buffer is 512 bytes.
2022-04-14 11:19:08 -05:00
Byron Lathi
c9269b2fb8 Fix some warnings
Adds some missing cases, length specifiers.
2022-04-11 16:13:38 -05:00
Byron Lathi
68a422d5e3 Disable signal tap 2022-04-11 16:03:50 -05:00
Byron Lathi
87d1457d94 Add logic to store and readback data from SD card
After a data read (e.g. CMD17) the data received from the SD card is
stored into a buffer which can be read back one byte at a time by the
CPU through address 5.

There is also a flag which is set when data is received. This can be
checked by reading the CMD register, which doubles as the status
register.
2022-04-11 13:57:56 -05:00
Byron Lathi
51c348bc7c Increase sd card addr width by 1
Adds a new memory location for data accesses.
2022-04-11 13:57:07 -05:00
Byron Lathi
f5f1d7ccc6 Add read flag to sd controller
Read flag is set when the sd controller reads response data in from the
sd card. When the cpu reads from the controller, the flag is reset.

This flag does not trigger an interrupt, it mmust be polled.
2022-04-10 23:16:10 -05:00
Byron Lathi
cd11670fb1 Add sd controller to top level
Also adds the logic required for the bidirectional sd lines and attaches
the controller to the cpu.
2022-04-10 17:54:08 -05:00
Byron Lathi
1128b986eb Fix state transitions with regard to clock
The SD card expects data to transition on falling edges and be stable on
rising edges.

Additionally, writes from the CPU were not handled with correct timing.

Now, there is an extra state when writing to the command register so
that the command is properly latched before the CRC is calculated.
2022-04-10 17:52:07 -05:00
Byron Lathi
50b0860137 Update testbench with more realistic timings
Updates the testbench to simulate writes with more correct timings.
Writes take two clock cycles since the cpu runs at half speed.
2022-04-10 17:50:49 -05:00
Byron Lathi
09428c8875 Add sd card cs 2022-04-10 16:15:55 -05:00
Byron Lathi
31a4656cac Reduce sd_controller addr width from 4 to 3 2022-04-09 17:31:25 -05:00
Byron Lathi
38566f7b4a add testbench for SD command tx
Sends a few commands which we know the proper checksum for and makes
sure that the bits on the output are correct.
2022-04-08 12:29:15 -05:00
Byron Lathi
f89ecfa038 Add SD Card controller for sending commands
Adds the start of the SD card controller which is capable of sending
commands using the SD protocol.

It is accessed by writing the arguments first and triggered by writing
the command number.
2022-04-08 12:28:17 -05:00
Byron Lathi
552fe8b6f8 Have valid crc when valid signal is present
Previously the crc would be reset after 1 clock cycle while the valid
signal was still high. Now the data is preserved in the valid state
until the load signal is asserted.
2022-04-08 12:25:17 -05:00
Byron Lathi
3e69109474 Add tests for crc7
These are just some values that I found from an example program. This
does not test every possible value.
2022-04-08 00:56:14 -05:00
Byron Lathi
e828df0807 Add crc7 module
This module takes in a 40 bit word and generates the 7 bit crc7
appropriate for an SD card.

It does not use any fancy parallel algorithm, it does it 1 bit at a
time.
2022-04-08 00:50:28 -05:00
Byron Lathi
f276c5469e Fix indentation 2022-04-08 00:49:59 -05:00
Byron Lathi
2f79a00000 Decode physical addresses instead of virtual.
address decoding is now performed on the translated address which comes
from the memory mapper, instead of the address coming directly from the
cpu.

This means that you can access the full amount of ram at any address
that it is mapped to.
2022-04-07 12:32:51 -05:00
Byron Lathi
5548f9d02a Update mm_testbench 2022-04-07 10:48:10 -05:00
Byron Lathi
7434621209 Update cs_testbench.sv 2022-04-07 10:40:11 -05:00
Byron Lathi
be497ecaa9 Add reset input to memory mapper
Upon reset the memory mapper is automatically disabled, but the mappings
are not cleared.
2022-04-07 10:35:16 -05:00
Byron Lathi
a15dde0e89 Add memory mapper software interface
Adds functions to read and write mappings, as well as enable and disable
the memory mapper.

This also moves increases the io space by 16 bytes.
2022-04-07 10:33:50 -05:00
Byron Lathi
d9474df523 Update cs_testbench.sv 2022-04-05 17:27:28 -05:00