Commit Graph

72 Commits

Author SHA1 Message Date
Byron Lathi
4fb73f8e97 Update cs_testbench.sv
Add uart_cs and fix error messages
2022-03-14 10:56:15 -05:00
Byron Lathi
a671fda51c Add sample puts function
"Hello, world!" :)
2022-03-14 10:46:36 -05:00
Byron Lathi
cfcf94a875 Integrate uart controller into top level module
Adds new chip select for the UART, and a new entry in the data_out mux
for the UART.
2022-03-14 10:45:45 -05:00
Byron Lathi
da4d5f0fe7 Add uart tests 2022-03-14 00:47:26 -05:00
Byron Lathi
0b5ccf48b8 Add basic UART driver
This didn't have a chance to get tested so I hope it works.

There is not fancy stuff here, just write to the register and wait till
it is done.
2022-03-14 00:24:08 -05:00
Byron Lathi
b48438f6b2 Add write and puts tasks to the uart testbench
The write task will transmit a single byte, the puts task will transmit
a string of length n. These do not do any verification, you still have
to look at the output.
2022-03-14 00:04:04 -05:00
Byron Lathi
f8da9206d9 Refactor uart.sv to better allow cpu control
Added new signal tx_flag, which indicates whether the transmitter is
ready for new data.

Added status register, which when read will return the tx_flag bit, as
well as others that can be implemented.

Added new state IDLE, which resets the TX flag and allows new data to be
written.

Added code to allow for different baud rates, though it is still fixed
currently.
2022-03-14 00:00:55 -05:00
Byron Lathi
e063e9f6a3 Add basic UART device
So far the device only transmits the ASCII set on repeat, but will
become fully featured later.
2022-03-13 19:42:41 -05:00
Byron Lathi
5834f179d2 Ignore more modelsim files
Ignore all bak files and msim_transcript
2022-03-13 19:39:14 -05:00
Byron Lathi
36ff20e587 Update Makefile
Add source as comment in assembly listings.
2022-03-12 22:40:48 -06:00
Byron Lathi
45af469029 Merge branch 'hex_driver' into 'master'
Add full seven segment display driver

See merge request bslathi19/super6502!2
2022-03-13 04:23:11 +00:00
Byron Lathi
d229052ed6 Add hex tests 2022-03-12 22:17:41 -06:00
Byron Lathi
a6bcadab6e Fix bugs in sevenseg.s
Fixed bug where we forgot to restore x in _hex_set_8 if the idx check
fails. We did remember to restore it if the check passed.

Fixed bug where _hex_set_24 did not return 0.
2022-03-12 22:10:37 -06:00
Byron Lathi
1a9290b97b Implement hex_set_24 2022-03-12 21:55:17 -06:00
Byron Lathi
226a2972cc Implement hex_set_16 2022-03-12 21:49:47 -06:00
Byron Lathi
c8a7cc4153 Implement enable byte in sw 2022-03-12 21:46:08 -06:00
Byron Lathi
c7e8cc3798 Implement enable byte in hw 2022-03-12 21:45:30 -06:00
Byron Lathi
9bbfce23e2 Add driver for hex digits
This only includes the method to set the pairs of displays individually.
The functions to write a single 16 or 32 bit value have not been
implemented yet, nor has the mask function.
2022-03-12 21:26:19 -06:00
Byron Lathi
627b6a746a Add high pair of seven segment displays
This also increases the number of registers to 4, one more for the high
pair of displays, and a final one for a mask register which has not been
implemented yet.
2022-03-12 21:24:37 -06:00
Byron Lathi
b4ff993080 Merge branch 'first_start' into 'master'
Get the FPGA part working

See merge request bslathi19/super6502!1
2022-03-13 01:44:41 +00:00
Byron Lathi
79675ec773 Clean up modelsim folder 2022-03-12 19:41:08 -06:00
Byron Lathi
28836259e2 Don't track vcd files either 2022-03-12 19:34:43 -06:00
Byron Lathi
b7c92d3117 Don't track signaltap 2022-03-12 19:30:37 -06:00
Byron Lathi
ca4288df66 Change addr_decode test to use new io locations
Instead of whatever was there before, the new io locations are ram, rom,
and the hex digits.
2022-03-12 19:25:34 -06:00
Byron Lathi
08af30e823 Remove C tests
The previous tests are not useful anymore.
2022-03-12 19:25:01 -06:00
Byron Lathi
5106e50395 Update bootstrap code
Was missing some things like initializing the stack pointer, clearing
BSS, and things like that
2022-03-11 22:57:22 -06:00
Byron Lathi
3d9d340520 Get the FPGA part working
This changes some of the clocks, fixes a bug in the seven segment stuff.
2022-03-11 22:55:26 -06:00
Byron Lathi
cdf3da9b13 Add hex drivers 2022-03-11 18:25:55 -06:00
Byron Lathi
bf28201832 Add basic hex digit code 2022-03-11 18:25:47 -06:00
Byron Lathi
58362d2ac8 Remove unused code 2022-03-11 18:24:04 -06:00
Byron Lathi
254d7b887e Update .gitlab-ci.yml 2022-03-10 22:27:43 +00:00
Byron Lathi
5d8c4aab44 Add USB code
Adds the usb code that we got in ECE 385. It will not work now, and
parts that involve the timer are disabled. It does compile though, with
a few warnings.

The goal will be to add USB MSD support, which is not actually given to
us so I will have to do myself or find some other code to base it off
of.
2022-03-10 16:15:08 -06:00
Byron Lathi
aca739338a Remove spi_word and replace with spi_deselect
Since the goal is to have the MAX3421E working, which uses multiple 8
bit transfers, we should support multiple 8 bit transfers instead of
trying to use 16 bit transfers.

When using spi_byte(), the device is automatically selected. After you
have made as many transfers as you want, you must deselect the device
with spi_deselect().
2022-03-10 14:43:49 -06:00
Byron Lathi
fe3851875d Add spi_word() 2022-03-10 13:38:39 -06:00
Byron Lathi
35973473d3 Change spi_write_byte to spi_byte
the SPI module reads and writes at the same time. If you don't want to
write a value, then write all zeros or whatever the device you are
communicating with wants.
2022-03-10 12:14:07 -06:00
Byron Lathi
236a75eef8 Update spi.s
Use names instead of magic values.
2022-03-10 11:29:32 -06:00
Byron Lathi
ee5271d955 Fix spi bug
Was reading a value from x, shifting it, but then not writing it back.
This caused an infinite loop as it would never move on from the MSB.
2022-03-10 11:16:35 -06:00
Byron Lathi
6f3155cf35 Add sim65 tests 2022-03-10 11:06:48 -06:00
Byron Lathi
eed7c21971 Update Makefile
Change lists to not have trailing slash

Remove listing folder during clean
2022-03-10 10:29:34 -06:00
Byron Lathi
fff193ea0f Add basic spi code
Implements the bit bang spi protocol
2022-03-10 10:26:36 -06:00
Byron Lathi
80d49b4f87 Update makefile
Generates listing files and a map file now.
2022-03-10 10:25:36 -06:00
Byron Lathi
3f5a653326 Rename assembly files from .S to .s 2022-03-10 10:17:37 -06:00
Byron Lathi
bac37bab55 Remove non existing import 2022-03-08 15:50:10 -06:00
Byron Lathi
2c26e82a0d Remove io c code 2022-03-08 15:41:03 -06:00
Byron Lathi
ad55f986f5 Add bb_spi_controller
Bit banged spi controller, very simple but very slow.
2022-03-08 15:26:01 -06:00
Byron Lathi
e1f50e825d Ignore gerber output files and folders 2022-03-08 15:25:05 -06:00
Byron Lathi
de320babfc Fix ground plane not connected 2022-03-08 15:23:20 -06:00
Byron Lathi
f1f1a90eeb Change IO_REMAP location 2022-03-05 23:23:05 -06:00
Byron Lathi
16b50dcca7 Add io chip select 2022-03-05 23:15:50 -06:00
Byron Lathi
0ad18720bb update cc65 docker image 2022-03-05 22:58:53 -06:00