Commit Graph

8540 Commits

Author SHA1 Message Date
Florent Kermarrec 240b24b7ff gen/fhdl/hierarchy: Use [] for BlackBoxes. 2022-11-08 15:08:12 +01:00
Florent Kermarrec b32d694ae4 interconnect/axi: Do not expose dest on AXI-Full (Only present for on AXI-Stream).
We are using AXI-Stream for AXI-Full channels, so do an exception for dest signal.
2022-11-08 14:52:05 +01:00
enjoy-digital f617e823b9
Merge pull request #1495 from Icenowy/openc906-debug
cpus/openc906: add debug variant like vexriscv
2022-11-08 14:01:40 +01:00
Icenowy Zheng 85273ffe99 cpu/openc906: add debug variant that connects CPU DM to main bus
The OpenC906 CPU core contains a RISC-V debug spec 0.13 compliant DM
with APB as its interface.

Add a CPU variant "debug" that will connect that APB to the main bus for
debugging.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-08 09:24:47 +08:00
Icenowy Zheng 9493338c68 cpu/openc906: fix the semantics of self.reset
LiteX defaults to active-high reset signals, but OpenC906 uses
active-low ones, and the self.reset signal of openc906 module is wrongly
wired that it will force the CPU to run instead of force it to reset
(because it is ORed and then feed to the active-low reset line).

Fix this by using AND and inverting self.reset.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-08 09:24:47 +08:00
enjoy-digital ff3bd11de1
Merge pull request #1494 from trabucayre/parset_fix_target_group
litex/build/parser: check if self._target_group is not None before calling add_argument
2022-11-07 21:03:37 +01:00
Gwenhael Goavec-Merou 98912f45e0 litex/build/parser: check if self._target_group is not None before calling add_argument 2022-11-07 20:40:09 +01:00
Florent Kermarrec 3269d12a27 gen/fhdl/hierarchy: Use ** for BlackBox for black/white consoles. 2022-11-07 19:19:14 +01:00
Florent Kermarrec f43b92103a build/sim/core/Makefile: Add -Wno-COMBDLY and -Wno-CASEINCOMPLETE flags to disable more these warnings (thanks @suarezvictor). 2022-11-07 15:26:35 +01:00
Florent Kermarrec 3c52d440a6 build/parser: Fix CPU listing when invalid one is provided and simplify. 2022-11-07 13:34:09 +01:00
Florent Kermarrec 1ce3271efe build/parser: Add LiteXSoCArgumentParser compatibility and switch to it in integration/soc.
Move things a bit to add target_group only when platform is set and avoid recursive imports.
2022-11-07 13:16:24 +01:00
Florent Kermarrec a2cb04b218 LICENSE: Update.
- Update project description.
- Add plain text BSD 2-Clause License for Github detection.
- Add LiteX developers to copyrights (similar to README).
- Add "moral" conditions for use of the project.
2022-11-07 10:00:59 +01:00
Florent Kermarrec 9ccf08e22d build/parser: Rename soc_core_argdict to soc_argdict.
The next move was to avoid use of soc_core_argdict and prefer use of soc_argdict directly,
so rename method now to avoid use on soc_core_argdict on targets/designs.
2022-11-07 08:45:24 +01:00
Icenowy Zheng 2e46a81bf6 tools/litex_sim: hack to allow memory base other than 0x40000000
The LiteX OpenC906 core currently uses 0x0 as the base of main memory.

Hack to allow this when preloading a binary in litex_sim by adding a
command line argument.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-07 11:48:15 +08:00
Florent Kermarrec 3b4bb083d4 build/parser: Fix CPU's args_read. 2022-11-06 21:51:29 +01:00
Florent Kermarrec 621c5cc187 build/argument_parser: Rename to parser to simplify name/imports. 2022-11-06 21:45:07 +01:00
Florent Kermarrec 6b541fb4fb build/nextpnr/yosys_wrapper: -x. 2022-11-06 21:21:23 +01:00
Florent Kermarrec c62306d57e build/argument_parser: Minor styles changes. 2022-11-06 21:19:17 +01:00
Florent Kermarrec 8040c83268 build/xilinx/platform: serie7 -> 7series. 2022-11-06 21:16:43 +01:00
enjoy-digital b9b165d25d
Merge pull request #1418 from trabucayre/rework_toolchain_args
build/lattice/platform: lattice_args, lattice_argdict: refactorize toolchains args
2022-11-06 21:15:36 +01:00
Gwenhael Goavec-Merou ad7ded9358 litex/litex/build: adding argument_parser (LiteXArgumentParser) to factorize toolchain aspects and common args 2022-11-06 11:22:49 +01:00
Gwenhael Goavec-Merou d061e9b9cf build/xxx/platform: adding methods to return toolchains list by device, and args by toolchain 2022-11-06 11:22:32 +01:00
Florent Kermarrec 38ee44a85a axi/axi_full: size/lock width are different on AXI3 and AXI4. 2022-11-04 12:35:09 +01:00
Florent Kermarrec 8f459a27dd integration/common/get_mem_data: Remove dead code (thanks @Rongronggg9).
See: https://github.com/enjoy-digital/litex/pull/1488#pullrequestreview-1168106543
2022-11-04 10:21:12 +01:00
Florent Kermarrec adea7879d7 gen/fhdl/verilog: Add Verilog Timescale generation. 2022-11-04 08:15:36 +01:00
enjoy-digital 2ae445018a
Merge pull request #1489 from shenki/crc-pie-fix
Do not build software as PIE
2022-11-04 07:52:45 +01:00
enjoy-digital 3a5a2b5c7d
Merge pull request #1488 from Icenowy/wide-soc
Misc changes for a wider SoC
2022-11-04 07:49:27 +01:00
enjoy-digital a253d7addc
Merge pull request #1487 from Icenowy/c906-ethmac-map
cpu/openc906: add ethmac to memory map and misc changes
2022-11-04 07:42:56 +01:00
Joel Stanley dd0918e9cc Do not build software as PIE
Some builds may default to creating position independent executables
with a .dynamic section containing symbols that must be relocated at
runtime. This section appears after .data section and is included in
the output .bin, causing it to be included in the build time CRC
calculation. The runtime CRC calculation stops after .data, so there
was always a mismatch.

The litex bios has no support for relocating the dynamic symbols, so
disable pie on all platforms. This will improve compatibility with
distro toolchains.

Tested with:

 marocchino / or1k-elf-gcc (GCC 12.1.0-2 Debian 1.0.3) 12.1.0

 vexriscv / riscv64-linux-gnu-gcc (Debian 12.2.0-3) 12.2.0

 microwatt / powerpc64le-linux-gnu-gcc (Debian 12.2.0-3) 12.2.0

Signed-off-by: Joel Stanley <joel@jms.id.au>
2022-11-04 16:29:42 +10:30
Icenowy Zheng 879f1b38bc integration/soc/add_sdram: connect to main bus with its data width
Currently we create a 32-bit Wishbone bus, connect LiteDRAM to it and
then connect it to the main SoC bus. This prevents us from getting
optimized performance from a wider main bus.

Make the intermediate bus to have the same width with the main bus.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-04 12:49:56 +08:00
Icenowy Zheng 5ff23066b7 integration/common/get_mem_data: add support for wider data widths
Currently the code only supports 32/64 bit SoC data width.

Add support for any possible data width that is multiply of 32-bit.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-04 12:49:56 +08:00
Icenowy Zheng dd6e4868f2 cpu/openc906: add ethmac to memory map and misc changes
The default ethmac section address conflicts with main_ram defined for
openC906.

Add a custom position of ethmac to the memory map, which directly
follows the internal APB.

Also fix the start address of checked IO region from 0xa0000000 to
the full Region 1 in sysmap.h, and add plic and clint sections like
other RISC-V CPU cores (although they're internal to the CPU and won't
be usable by LiteX).

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-04 12:47:20 +08:00
enjoy-digital eb2e9a371d
Merge pull request #1485 from Icenowy/64bit-systembus-csr-fix
soc/interconnect/csr: Fix CSR on 64-bit SoC bus width
2022-11-03 21:27:19 +01:00
enjoy-digital b8e007540c
Merge pull request #1486 from alanvgreen/terms
litex/soc: update API to avoid unfortunate terms
2022-11-03 21:25:48 +01:00
Alan Green 61be01ebd4 litex/soc: update API to avoid unfortunate terms
Provides an alternate API to some functions of the SoCBusHandler and bus
Arbiter classes to allow users of the API to avoid the terms 'master'
and 'slave' in certain situations.

Signed-off-by: Alan Green <alan.green@gmail.com>
2022-11-04 06:03:34 +11:00
Florent Kermarrec 21e46b6b6c tools/litex_sim: Avoid use of SoCCore.add_memory_region/add_wb_slave. 2022-11-03 19:22:26 +01:00
Florent Kermarrec 964c82e4e8 soc_core: Move methods that are no longer recommended to compat_soc_core and add compat_notice to them.
These methods were already a compatibility layer for SoC/LiteXSoC and are not recommended
in new designs.
2022-11-03 19:10:31 +01:00
Florent Kermarrec f64dc2b799 gen/fhdl/hierachy: Improve and give names to unnamed modules. 2022-11-03 16:20:07 +01:00
Florent Kermarrec 9321380f48 litex/gen/fhdl: Add initial LiteXHierarchyExplorer and use it to display hierarchy when building SoC. 2022-11-03 10:57:40 +01:00
Florent Kermarrec 507ffb72b5 colorer: Avoid duplication and move it to litex/gen. 2022-11-03 09:49:51 +01:00
enjoy-digital 3986a5b27e
Merge pull request #1484 from cklarhorst/i2c_addr
soc/software: Support non 8bit i2c memory addresses
2022-11-03 09:25:41 +01:00
Icenowy Zheng 0c705537af soc/interconnect/csr: Fix CSR on 64-bit SoC bus width
Currently the code uses the SoC bus width to calculate the alignment of
CSR banks.

However when we get AXI-Lite interconnect support, the CSR bus is not
directly converted from SoC bus now, instead an intermediate bus with
default parameter (which means 32-bit) is created, CSR bus is converted
from it, and finally this bus is attached to the main interconnect with
auto converter if needed. In this case the intermediate bus is always of
32 bit bus width, eliminating the need of caring the SoC bus width when
handling CSR banks.

Tested on 64-bit SoC bus width now; to make the bus further wider,
other codes need to be changed either.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-02 23:37:48 +08:00
Christian Klarhorst fa3b4a1f1f soc/software: Support non 8bit i2c memory addresses
Add another parameter to i2c_read/write to specify the size
(in bytes) of the addresses.
2022-11-02 12:45:14 +01:00
enjoy-digital f71bda1c61
Merge pull request #1482 from Icenowy/openc906-fix
misc openc906 fixes and enhancements
2022-11-02 08:36:33 +01:00
Icenowy Zheng 0f097fd4c7 cpu/openc906: misc fixes/enhancements related to L1$
Currently L1$ flush code does not work well because of lack of
synchorizing.

Switch to use T-Head extended instructions instead of CSRs to flush L1
cache (both D and I), and THEADISAEE is set for this.

In addition, Some other performance-related options are enabled too,
including branch predicting, cache prefetching, etc.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2022-11-01 16:10:46 +08:00
Florent Kermarrec cd2805b422 soc/SoCBusHandler: Set default _interconnect to None. 2022-10-31 09:40:36 +01:00
enjoy-digital c71db5159b
Merge pull request #1448 from tpwrules/fix-framebuffer-colors
soc/cores/video: fix framebuffer color output
2022-10-30 21:26:10 +01:00
enjoy-digital 9497b0cdf5
Merge pull request #1481 from alanvgreen/with-cxx
soc/software/demo/Makefile: define WITH_CXX
2022-10-30 21:25:37 +01:00
enjoy-digital 3704e36c7e
Merge pull request #1476 from shenki/riscv-toolchain
riscv: Fix compilation with new binutils
2022-10-30 21:25:18 +01:00
enjoy-digital 7142d25e98
Merge pull request #1475 from shenki/vhd2v-ghdl
vhd2v: Use GHDL directly
2022-10-30 21:24:44 +01:00