Andrea Venturi
5c3487be49
add PCF file for UP5K part on upduino
2018-01-23 19:47:28 +01:00
Andrea Venturi
e93fb454bf
add TCL script for firmware creation
2018-01-23 19:47:00 +01:00
Andrea Venturi
a9c0d91341
support up5k FPGA with internal OSC
2018-01-23 18:17:44 +01:00
Graham Edgecombe
f5a046f678
Replace x0 with zero
2018-01-05 20:42:57 +00:00
Graham Edgecombe
a1fb770982
Add README and LICENSE
2018-01-04 22:48:30 +00:00
Graham Edgecombe
b4c58919b6
Disable CSR writes if the execute stage is stalled
2018-01-01 19:30:31 +00:00
Graham Edgecombe
d7e417df0b
Add BAUD_RATE constant
2018-01-01 14:39:05 +00:00
Graham Edgecombe
2a1ec25a66
Make RV32_ISA_VALUE comment consistent with the opcodes comment
2017-12-31 17:11:56 +00:00
Graham Edgecombe
e9d60ba3e9
Hard-wire pmpcfg and pmpaddr CSRs to 0
2017-12-31 16:55:25 +00:00
Graham Edgecombe
0f094c67db
Hard-wire hpmevent and hpmcounter CSRs to 0
2017-12-31 16:03:11 +00:00
Graham Edgecombe
5011731355
Add mcycle and minstret CSRs
2017-12-31 15:43:06 +00:00
Graham Edgecombe
98811cce86
Explicitly instantiate all registers to 0
2017-12-31 15:38:07 +00:00
Graham Edgecombe
26ec3542e4
Add mscratch CSR
2017-12-31 11:13:07 +00:00
Graham Edgecombe
73717d320d
Fix CSR write value mux
2017-12-31 11:12:56 +00:00
Graham Edgecombe
63c5585fda
Add misa CSR
2017-12-31 10:36:25 +00:00
Graham Edgecombe
a430c50f16
Add machine information CSRs
2017-12-31 10:29:17 +00:00
Graham Edgecombe
426daa39d6
Replace binary CSR constants with hex
...
This matches the documentation.
2017-12-31 10:15:46 +00:00
Graham Edgecombe
62ea036b23
Add missing csr_src connection from the control unit to the flip flop
2017-12-30 15:37:01 +00:00
Graham Edgecombe
dd52e5c318
Declare {ram,leds,uart}_sel before using them
2017-12-30 15:24:52 +00:00
Graham Edgecombe
8024a6075f
Move result zero/non-zero test to the execute stage
...
This reduces the amount of logic required and should speed the processor
up slightly, as the critical path had moved from the execute stage to
the branching logic in the mem/fetch stages.
2017-12-30 14:12:23 +00:00
Graham Edgecombe
6c964c75e5
Add static branch prediction
2017-12-30 13:48:14 +00:00
Graham Edgecombe
276688f9ef
Move CSR access to the execute stage
...
This reduces the amount of logic slightly, and also removes the one
cycle delay between a CSR read and a subsequent instruction reading from
the destination register.
2017-12-30 11:34:14 +00:00
Graham Edgecombe
b0c05a908e
Move mem_read_value declaration below the memory access unit comment
2017-12-30 11:02:18 +00:00
Graham Edgecombe
eac6a20040
Only stall the pipeline if rs1/rs2 are read
2017-12-29 20:37:02 +00:00
Graham Edgecombe
3f19fc4226
Replace parallel 32-bit adders with a single 64-bit adder
2017-12-29 17:24:04 +00:00
Graham Edgecombe
3806106b1c
Replace -Os with -O2
...
-Os seems to optimize away the UART code. I'm not sure why, as all the
pointers are volatile.
2017-12-29 17:18:36 +00:00
Graham Edgecombe
d73b443ecc
Replace __asm__ with asm
2017-12-29 17:09:53 +00:00
Graham Edgecombe
08e79c32e0
Delete timing/icestat reports in the clean target
2017-12-29 16:27:35 +00:00
Graham Edgecombe
21e7ee2b8c
Remove unused stall_in input from rv32_csrs
2017-12-29 16:26:11 +00:00
Graham Edgecombe
63cd024d5c
Fix instret rollover
2017-12-29 16:23:33 +00:00
Graham Edgecombe
0939363a3f
Add rdcycle demo
2017-12-29 16:09:41 +00:00
Graham Edgecombe
20de15c3e5
Pass -Os to gcc
2017-12-29 16:09:19 +00:00
Graham Edgecombe
0bc2871ded
Link with gcc instead of ld
2017-12-29 15:48:16 +00:00
Graham Edgecombe
4b6218c2a8
Add initial CSR support
2017-12-29 15:29:15 +00:00
Graham Edgecombe
de1f936cdd
Implement FENCE.I
2017-12-27 15:23:59 +00:00
Graham Edgecombe
0013935bb0
Split decode stage into smaller modules
...
This increases the number of LUTs slightly (by ~20), as the immediate
mux is now separate to the main control unit, but I think it's worth the
cost.
The imm output is also renamed to imm_value. This is consistent with
rs1_value and rs2_value, and avoids a collision with the new imm output,
which represents the type of immediate.
2017-12-27 14:05:09 +00:00
Graham Edgecombe
2b1e0de9de
Propagate mem_fence signal through the pipeline
2017-12-26 16:46:01 +00:00
Graham Edgecombe
f8b8842abc
Bump FREQ_PLL to 36 MHz again
2017-12-26 14:40:54 +00:00
Graham Edgecombe
b73a0155dd
Swap byte order in the ram module
...
Although the processor uses little-endian addressing, the memory bus
itself is big-endian. (This simplifies the implementation of
memory-mapped registers.)
However, this does mean the contents of the RAM need to be in big-endian
order, rather than little-endian order. $readmemh does not provide any
control over byte order, so we previously swapped the byte order of
progmem.hex with srec_cat in the Makefile.
This commit changes the ram module to swap the byte order upon
reading/writing. This removes the need to use srec_cat in the Makefile.
Swapping the byte order in hardware shouldn't cause any performance
impact as it just involves re-arranging wires.
2017-12-26 14:15:12 +00:00
Graham Edgecombe
3c2f7518ec
Add new 'hello world' demo program
2017-12-26 13:46:20 +00:00
Graham Edgecombe
2ba26fc7e6
Switch from big- to little-endian ordering in the memory access stage
...
The previous implementation mistakenly used big-endian instead of
little-endian.
2017-12-26 13:40:55 +00:00
Graham Edgecombe
b578251132
Add rodata to the linker script
2017-12-25 23:42:32 +00:00
Graham Edgecombe
9b1e27cc0d
Combine the instruction and data buses
2017-12-25 23:33:53 +00:00
Graham Edgecombe
7f81e495b3
Add write enable output to the memory bus
...
This will be used by the bus arbiter and the hazard unit. We could use
the write_mask output, but this would introduce a longer delay.
2017-12-17 20:47:17 +00:00
Graham Edgecombe
7ef3e831ce
Prefix data bus wire names with data_
2017-12-17 19:57:00 +00:00
Graham Edgecombe
b01e81357d
Re-use the main adder to implement the LUI, JAL and JALR instructions
2017-12-16 12:45:43 +00:00
Graham Edgecombe
135a081fd4
Remove unused clk_div.sv include
2017-12-16 11:32:32 +00:00
Graham Edgecombe
bfbe3be490
Add FREQ macro to avoid hard-coding 36 MHz
2017-12-15 20:21:12 +00:00
Graham Edgecombe
e4e2e65293
Port example program to C
2017-12-15 20:08:55 +00:00
Graham Edgecombe
d97f8c5e8e
Add yosys-config --datdir workaround
...
The yosys-git AUR package doesn't set the PREFIX variable correctly.
2017-12-15 18:35:26 +00:00