Commit Graph

8927 Commits

Author SHA1 Message Date
Icenowy Zheng 8ffabe3bcb soc/cores/cpu: add initial OpenC906 support
It's only boot tested in sim and build tested in Vivado now, and it
requires a FPGA > 100k LUT4 (XC7A100T currently does not fit).

The ISR code is based on Rocket one.

These Python code depends on a forked version of OpenC906 at [1].

[1] https://github.com/Icenowy/openc906/tree/fpga-optimization

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-06-14 02:04:58 +08:00
Icenowy Zheng 6d11d1991b build/altera: Add derive_pll_clocks to SDC file
Quartus software wants a derive_pll_clock sentence in SDC file to enable
automatic PLL clock derivation, and by test this sentence is harmless
even when no PLL exists.

Add this sentence to to the generated SDC file.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-06-13 22:51:54 +08:00
Icenowy Zheng 58f9a79cf3 cores/clock/intel_common: fix N factor not get passed to ALTPLL primitive
The N factor is currently ignored when creating ALTPLL instance.

As Quartus will internally decide N based on all dividers, just multiply
N to all clock outputs' individual divider.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-06-13 22:51:20 +08:00
Florent Kermarrec 49d0463394 integration/export/csr: Allow disabling CSR_BASE #define/reuse when not wanted.
Reuse of external defined CSR_BASE has been added for some use-cases, allowing more
flexilibity but also complicating direct read of base addresses for users in csr.h.


with_csr_base_define parameter has been added, allowing disabling CSR_BASE #define/reuse
when set to False.
2022-06-09 16:39:29 +02:00
Florent Kermarrec 8ccfc96b1a build/osfpga: Fix device support. 2022-06-08 18:25:50 +02:00
Mikołaj Sowiński 59ca268de9 Updated OpenOCD stream for expr use deprecation in v0.11 2022-06-08 15:07:58 +02:00
Florent Kermarrec eeed11edea build/osfpga: Remove .init workaround since fixed in toolchain. 2022-06-07 12:34:42 +02:00
enjoy-digital 24e483026d
Merge pull request #1325 from AEW2015/litex_dev
adding JTAG support for the xcau, Xilinx Artix UltraScale+
2022-06-07 12:11:57 +02:00
Andrew E Wilson 9691d205b7 adding JTAG support for the xcau, Xilinx Artix UltraScale+ 2022-06-07 00:45:27 -06:00
enjoy-digital 50613f74c0
Merge pull request #1323 from jevinskie/jev/feat/intel-clocking-find-best-config
IntelClocking: Brute-force find the best PLL config.
2022-06-06 21:58:49 +02:00
enjoy-digital d1d0f70b2e
Merge pull request #1324 from jevinskie/jev/bug/quartus-build-script-win32-fix
Quartus: Remove bashism from win32 bat script and add shebang on Linux
2022-06-06 21:56:57 +02:00
Jevin Sweval ace1314e02 Quartus: Remove bashism from win32 bat script and add shebang on Linux 2022-06-06 11:32:36 -07:00
Jevin Sweval fa8d31b101 IntelClocking: Brute-force find the best PLL config. 2022-06-06 11:13:52 -07:00
Florent Kermarrec d537e30c5a bios/main: Add CONFIG_NO_BOOT support to allow disabling Boot sequence and minor cleanups. 2022-06-06 18:28:39 +02:00
Dolu1990 c299a82968
Merge pull request #1321 from zeldin/vexriscv_crt_fix_2
cpu/vexriscv: Redo csr instruction fix
2022-06-06 11:41:11 +02:00
Marcus Comstedt 91d79ae1da cpu/vexriscv: Redo csr instruction fix
Instead of enabling the zicsr extension in crt0.S, change -march to
specify that VexRISCV implements version 2.0 of I, rather than the
latest (2.1).  In 2.0 the csr instructions were still part of I.
This approach has two advantages:

* It is compatible with older versions of binutils, since they do not
  need to know about the new zicsr extension

* By modifying the -march in CFLAGS, csr instructions can be used in any
  code (for example by the inline functions in irq.h), not just in crt0.S.
2022-06-04 13:59:51 +02:00
Florent Kermarrec 3f8cafeb58 test/test_cpu: Disable cva5 and enable marocchino/mor1kx. 2022-06-03 17:14:52 +02:00
Florent Kermarrec c0fc342823 test/test_cpu: Simplify using subTest/lists, test more RISC-V CPUs and comments for untested CPUs.
Also use --opt-level=O0 to reduce compilation time (execution is a bit slower but since we are only
executing the BIOS here, total test time is still reduced).
2022-06-03 16:16:21 +02:00
Florent Kermarrec eab58ff0e9 software/common.mak: Remove GCC_PATH introduced by #1279 since create lots of warning with regular toolchains. 2022-06-03 15:11:01 +02:00
Florent Kermarrec 481857ad0a bios/boot: Disaboe netboot_from_bin when no MAIN_RAM. 2022-06-03 14:53:15 +02:00
Florent Kermarrec 5c493af573 tools/litex_sim: Update/Fix --with-ethernet. 2022-06-03 14:52:48 +02:00
Florent Kermarrec 3ab7eaa5f7 software/common: Disable LTO since does not seems to work in all cases and cause random issues.
LTO will have to be properly tested before being enabled.
2022-06-03 14:42:04 +02:00
Florent Kermarrec b88bcd8e87 litex_setup: Bump RISC-V GCC toolchain to 10.1. 2022-06-03 14:34:01 +02:00
Florent Kermarrec e0a549f8ea integration/export: Disable riscv_zicsr workaround for now since does not seems working. 2022-06-03 13:31:59 +02:00
Florent Kermarrec 3acf22ff6f cores/clock/gowin_gw2a: Fix copyrights. 2022-06-03 12:04:11 +02:00
Florent Kermarrec 67b415f61c cores/clock: Add gowin_gw2a (Reusing GW1NPLL with specific vco/pfd_freq_ranges). 2022-06-03 12:01:08 +02:00
Florent Kermarrec f0ea2cb0fa clock/gowin_gw1n: Add get_vco/pfd_freq_range methods and switch to it. 2022-06-03 11:53:55 +02:00
enjoy-digital f33ea63278
Merge pull request #1316 from gsomlo/gls-printf-warning
software/liblitesata: address printf int size warning
2022-06-02 21:29:39 +02:00
Florent Kermarrec 31439f7475 software/common.mak: Shorten GCC_INSTALLATION_PATH to GCC_PATH. 2022-06-02 18:41:55 +02:00
Florent Kermarrec bafae4d449 soc/integration/export: Rewrite and fix zicsr RISC-V workaround.
- Improve regex to be more robust (Was not working with binutils from Sifive).
- Improve readability.
- Only do it for RISC-V.
- Add comments.
2022-06-02 18:39:50 +02:00
enjoy-digital 9e38dc70a4
Merge pull request #1279 from xhebox/master
support custom toolchain
2022-06-02 18:05:51 +02:00
enjoy-digital e0f183c219
Merge pull request #1317 from Icenowy/gw2apll
GW1NPLL: add GW2A
2022-06-02 17:32:35 +02:00
Icenowy Zheng c66ba025f8 GW1NPLL: add GW2A
GW2A has the same PLL primitive with GW1N.

Add support for it to GW1NPLL.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-06-02 21:19:41 +08:00
Gabriel Somlo 712bfe27ca software/liblitesata: address printf int size warning
uint32_t is treated as `unsigned int` by the 64-bit compiler, and
as `long unsigned int` by the 32-bit compiler. As such, we'll get
a warning on one or the other regardless of whether we use "%ld"
or "%d" with printf:

on 64-bit (rocket, using "%ld"):

./litex/litex/soc/software/liblitesata/sata.c: In function 'sata_init':
./litex/litex/soc/software/liblitesata/sata.c:87:45:
    warning: format '%ld' expects argument of type 'long int', but
    argument 2 has type 'uint32_t' {aka 'unsigned int'} [-Wformat=]
   87 |     printf("Capacity: %ldGB\n", capacity);
      |                       ~~^       ~~~~~~~~
      |                         |       |
      |                         |       uint32_t {aka unsigned int}
      |                         long int
      |                       %d

on 32-bit (vexriscv, using "%d"):

./litex/litex/soc/software/liblitesata/sata.c: In function 'sata_init':
./litex/litex/soc/software/liblitesata/sata.c:87:44:
    warning: format '%d' expects argument of type 'int', but
    argument 2 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
   87 |     printf("Capacity: %dGB\n", capacity);
      |                       ~^       ~~~~~~~~
      |                        |       |
      |                        int     uint32_t {aka long unsigned int}
      |                       %ld

This patch changes `capacity` to `unsigned`, which has the same size
as `uint32_t`, but has the advantage of being treated the same by
`printf` regardless of whether we use the 32- or 64-bit compiler.
2022-06-01 10:52:52 -04:00
Florent Kermarrec a977adf551 build/osfpga: Add workaround to copy .init file to work directory. 2022-05-27 19:39:42 +02:00
Tim 'mithro' Ansell c401bdd7f1
Merge pull request #1287 from antmicro/update-zephyr-dts-script
tools: litex_json2dts_zephyr: Comply with changes in Zephyr
2022-05-26 08:27:13 -07:00
Michal Sieron dbe8348288 Add i2s and mmcm handlers 2022-05-26 09:55:14 +02:00
Michal Sieron cd5148d961 Update litex_json2dts_zephyr
Changes in Zephyr require updated script to generate correct overlay.

This commit splits CSR regions that were being added to overlay as
single register into separate registers with names.

It also prints their size in bytes instead of used subregisters.

I also added LITEX_CSR_DATA_WIDTH to generated config parameters.

To limit code duplication, I added functions used for indenting text.
Additionally, I updated formatting functions to take list of registers
and then format it, instead of just surrounding already formatted text
with braces.
2022-05-26 09:54:43 +02:00
Florent Kermarrec 0714769926 cores/cpu/cva5: Cleanup/Simplify. 2022-05-25 15:42:31 +02:00
Florent Kermarrec b59a62e51c cpu/cva6: Add category. 2022-05-25 15:24:30 +02:00
Florent Kermarrec ae89c6bfa4 litex_setup: Only include CVA5 with full install. 2022-05-25 15:20:56 +02:00
enjoy-digital 888f2d1648
Merge pull request #1300 from e-matthews/cva5
Add initial CVA5 support
2022-05-25 15:19:51 +02:00
enjoy-digital ffcf2fca49
Merge branch 'master' into cva5 2022-05-25 15:18:17 +02:00
Florent Kermarrec 3e388a5b58 cores/cpu: Improve address readability with underscores. 2022-05-25 11:40:35 +02:00
Florent Kermarrec e1c132809e cpu/cva6: Only keep AXI<->AXI-Lite conversion. 2022-05-25 11:28:32 +02:00
Florent Kermarrec 808f29ed2e cpu/cva6/core: Cleanup/Simplify integration.
- Cosmetic changes and increase similarities with other CPUs.
- Simplification.
- Allow converting AXI to Wishbone or AXI-Lite (Still keep wishbone as default).
- Connect reset from SoC.
- Reorder AXI signals by channels.
- Move JTAG integration to add_jtag method.
2022-05-25 10:20:09 +02:00
Florent Kermarrec 69451fad09 test/test_cpu: Disable test_cva6 for now since seems to be failing. 2022-05-25 09:32:30 +02:00
Florent Kermarrec db407b973c litex_setup: Switch CVA6 to litex-hub and order CPU list per ISA. 2022-05-25 09:29:23 +02:00
Florent Kermarrec 73c76c6126 tools/litex_sim: Add pre-definied commented config flags. 2022-05-25 09:17:36 +02:00
Florent Kermarrec 7028745829 bios/main: Add CONFIG_BIOS_NO_CRC to disable CRC Check (Useful in simulation). 2022-05-25 09:16:48 +02:00