Commit Graph

2066 Commits

Author SHA1 Message Date
enjoy-digital 33c7b2ce6b
Merge pull request #472 from antmicro/jboc/sdram-calibration
bios/sdram: add automatic cdly calibration during write leveling
2020-04-25 09:59:08 +02:00
enjoy-digital 4608bd1864
Merge pull request #470 from antmicro/jboc/sdram-eeprom-timings
litex_sim: add option to create SDRAM module from SPD data
2020-04-25 08:27:00 +02:00
Jakub Cebulski a344e20b5e spi_flash: fix building without bitbang 2020-04-24 17:45:17 +02:00
Jędrzej Boczar ab92e81e31 bios/sdram: add automatic cdly calibration during write leveling 2020-04-24 14:00:42 +02:00
Florent Kermarrec 22c3923644 initial SERV integration. 2020-04-23 08:18:41 +02:00
Florent Kermarrec 0b3c4b50fa soc/cores/spi: add optional aligned mode.
In aligned mode, MOSI and MISO bits are located on the LSBs and first transmitted MOSI bit is length - 1 bit.
2020-04-22 13:15:51 +02:00
Florent Kermarrec 6bb22dfe6b cores/spi: simplify. 2020-04-22 12:20:23 +02:00
Florent Kermarrec fc434af949 build/lattice/common: add specific LatticeiCE40SDROutputImpl/LatticeiCE40SDRTristateImpl (thanks @tnt). 2020-04-22 12:01:23 +02:00
Florent Kermarrec 1457c32052 xilinx/common: use a common SDRTristate implementation for Spartan6, 7-Series and Ultrascale. 2020-04-22 10:42:06 +02:00
Florent Kermarrec 69462e6669 build/xilinx/common: add 7-Series/Ultrascale SDROutput/Input. 2020-04-22 10:33:22 +02:00
Florent Kermarrec 65e6ddc6cd lattice/common: add LatticeECP5DDRInput. 2020-04-22 10:13:28 +02:00
Florent Kermarrec 2031f28057 lattice/common: cleanup instances, simplify tritates. 2020-04-22 09:07:38 +02:00
Florent Kermarrec 2d25bcb09c lattice/common: add LatticeiCE40DDRInput, LatticeiCE40SDROutput and LatticeiCE40SDRInput. 2020-04-22 09:07:33 +02:00
Florent Kermarrec 56e1528455 platforms/de0nano: swap serial tx/rx to ease use of cheap FT232 based cables. 2020-04-18 11:38:24 +02:00
Florent Kermarrec 08e4dc02ec tools/remote/etherbone: update import. 2020-04-17 21:30:33 +02:00
Jędrzej Boczar b0f8ee9876 litex_sim: add option to create SDRAM module from SPD data 2020-04-17 14:52:53 +02:00
Florent Kermarrec 19f983c420 targets: manual define of the SDRAM PHY no longer needed. 2020-04-16 11:26:59 +02:00
Florent Kermarrec c0f3710d66 bios/sdram: update/simplify with new exported LiteDRAM parameters. 2020-04-16 10:42:01 +02:00
Florent Kermarrec 3915ed9760 litex_sim: add phytype to PhySettings. 2020-04-16 10:22:43 +02:00
Florent Kermarrec c0c5ae558a build/generic_programmer: move requests import to do it only when needed. 2020-04-16 08:44:36 +02:00
Florent Kermarrec c9ab593989 bios/sdram/ECP5: set ERR_DDRPHY_BITSLIP to 4.
Bitslip software control is now used on ECP5 to move dqs_read.
2020-04-15 19:30:28 +02:00
Florent Kermarrec 5e149ceda2 build/generic_programmer: add automatic search/download of flash_proxy in repositories if not available locally. 2020-04-15 08:59:03 +02:00
Mateusz Holenko 77a05b78e8 soc_core: Fix region type generation
Include information about being a linker region.
2020-04-14 21:45:32 +02:00
Florent Kermarrec d44fe18bd9 stream/AsyncFIFO: add default depth (useful when used for CDC). 2020-04-14 17:35:19 +02:00
Florent Kermarrec ded10c89dc build/sim/core/Makefile: add -p to mkdir modules. 2020-04-14 12:38:02 +02:00
enjoy-digital c323e94c83
Merge pull request #464 from mithro/litex-sim-fixes
Improve the litex_sim Makefiles
2020-04-14 12:16:21 +02:00
Tim 'mithro' Ansell 97d0c525ee Remove trailing whitespace. 2020-04-12 10:29:13 -07:00
Florent Kermarrec 4fe31f0760 cores: add External Memory Interface (EMIF) Wishbone bridge.
Useful to interface Processors/DSPs with LiteX. EMIF is generally used on Texas Instrument DSPs.
2020-04-12 16:34:33 +02:00
Rangel Ivanov c57e438df6 boards/targets/ulx3s.py: Update --device option help message
Signed-off-by: Rangel Ivanov <rangelivanov88@gmail.com>
2020-04-12 12:01:31 +03:00
Rangel Ivanov f4b345ecd7 build/lattice/trellis.py: Add 12k device
nextpnr adds the --12k option which is the same like
the --25k but with the correct idcode for the 12k devices

Signed-off-by: Rangel Ivanov <rangelivanov88@gmail.com>
2020-04-12 11:46:44 +03:00
Tim 'mithro' Ansell 1f35669508 litex_sim: Find tapcfg from pythondata module. 2020-04-11 18:38:15 -07:00
Tim 'mithro' Ansell ebcb2a4406 Rename litex-data-XXX-YYY to pythondata-XXX-YYY 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell e618d41ffb Fixing mor1kx data finding. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell 2e3b7f20c7 Fix typo in error message. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell 83b2581331 Fix the libcompiler_rt path. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell 1c1c5bcbda Remove submodules. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell c96d1e6672 Fix import for data. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell 69367f8d4e Make litex a namespace. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell d5a21a7522 Converting litex to use Python modules. 2020-04-11 18:37:06 -07:00
Tim 'mithro' Ansell 5a0bb6ee01 litex_sim: Rework Makefiles to put output files in gateware directory. 2020-04-11 18:37:03 -07:00
Tim 'mithro' Ansell a0658421cc litex_sim: Better error messages on failure to load module. 2020-04-11 18:35:39 -07:00
Florent Kermarrec b95e0a19b1 altera/common: add DDROutput, DDRInput, SDROutput, SDRInput. 2020-04-10 15:50:35 +02:00
Florent Kermarrec 40f43efcf6 targets: use DDROutput on sdram_clock and similar configuration for all SDRAM targets. 2020-04-10 14:41:01 +02:00
Florent Kermarrec 292d6b75b6 build/xilinx/common: add Spartan6 specialized DDRInput, SDROutput, SDRInput and SDRTristate. 2020-04-10 14:38:22 +02:00
Florent Kermarrec 88dc5158c1 build/io: add SDR Tristate (with infered version) and remove multi-bits support on SDRIO. 2020-04-10 14:37:29 +02:00
Florent Kermarrec fdadbd868b build/lattice/common: remove multi-bits support on SDRInput/Output. 2020-04-10 14:36:13 +02:00
Florent Kermarrec 8159b65bee litex/build/io: also import CRG (since using DifferentialInput). 2020-04-10 10:25:21 +02:00
Florent Kermarrec 79913e8614 litex.build: update from migen.genlib.io litex.build.io. 2020-04-10 09:49:45 +02:00
Florent Kermarrec 8e014f76da litex/build: move io.py from litex/gen and re-import DifferentialInput/Output, DDRInput/Output contributed to Migen.
This will make things easier and more consistent, all special IO primitives are now in LiteX.
2020-04-10 08:47:07 +02:00
Florent Kermarrec 2e270cf28c platforms/versa_ecp5: remove Lattice Programmer (no longer used since we can now use OpenOCD). 2020-04-09 23:08:59 +02:00
Florent Kermarrec deebc49ab0 boards/platforms: cosmetic cleanups. 2020-04-09 23:04:29 +02:00
Florent Kermarrec 3c0ba8ae62 boards/plarforms/ulx3s: cleanup, fix user_leds, add spisdcard, add PULLMODE/DRIVE on SDRAM pins. 2020-04-09 18:55:01 +02:00
Florent Kermarrec 6c429c9995 build/lattice: add ECP5 implementation for SDRInput/SDROutput. 2020-04-09 16:24:05 +02:00
Florent Kermarrec 72c8d590fa litex/gen: add io with SDRInput/SDROutput (if not overrided, register is supposed to be infered). 2020-04-09 16:23:27 +02:00
Florent Kermarrec 8f57321f30 tools/litex_sim: remove LiteSPI support for now since breaking Travis-CI of others sub-projects.
LiteSPI is not mature enough to be integrated in LiteX sim directly. (will case trouble is things are refactored).

This could be re-introduced later when more mature. For now simulation with LiteX Sim
could be tested directly in LiteSPI with a custom simulation.
2020-04-09 11:14:19 +02:00
Florent Kermarrec 9afd017a3a tools/litex_term: increase workaround delay for usb_fifo. (validated on Minispartan6 and MimasA7).
Still needs to be fixed properly.
2020-04-09 10:52:15 +02:00
David Sawatzke d69b4443b3 Add riscv64-none-elf triple 2020-04-09 05:36:10 +02:00
Florent Kermarrec 14bf8b8190 soc/cores/clock: add Max10PLL. 2020-04-08 08:54:12 +02:00
Florent Kermarrec 2470ef5096 soc/cores/clock: add Cyclone10LPPLL. 2020-04-08 08:33:57 +02:00
Florent Kermarrec f8d6d0fda8 soc/cores/clock/CycloneVPLL: fix typos. 2020-04-08 08:25:46 +02:00
Florent Kermarrec 970c8de4c2 soc/cores/clock: rename Altera to Intel. 2020-04-08 08:16:37 +02:00
Florent Kermarrec 383fcd36d6 soc/cores/clock: add CycloneVPLL. 2020-04-07 17:24:12 +02:00
Florent Kermarrec ab4906ea3b targets/de0nano: use CycloneIVPLL, remove 50MHz limitation. 2020-04-07 17:00:45 +02:00
Florent Kermarrec 0f17547c5b soc/cores/clock: add initial AlteraClocking/CycloneIV support. 2020-04-07 16:59:53 +02:00
Florent Kermarrec 0f352cd648 soc/cores: use reset_less on datapath/configuration CSRStorages. 2020-04-06 13:17:14 +02:00
Florent Kermarrec a67ab41835 interconnect/csr: add reset_less parameter.
In cases CSRStorage can be considered as a datapath/configuration register and does not need to be reseted.
2020-04-06 13:15:08 +02:00
Florent Kermarrec 05b1b7787b interconnect/csr, wishbone: use reset_less on datapath signals. 2020-04-06 13:11:50 +02:00
Florent Kermarrec b95965de73 cores/code_8b10b: set reset_less to True on datapath signals.
Reset is only required on control signals.
2020-04-06 11:35:18 +02:00
Florent Kermarrec a35df4f7d1 stream: set reset_less to True on datapath signals.
Reset is only required on control signals.
2020-04-06 11:33:49 +02:00
kessam fb532f5e92
Fix timing constraints 2020-04-05 17:56:29 +02:00
Florent Kermarrec 6043108376 soc/cores/clock/ECP5PLL: add CLKI_DIV support. 2020-04-03 11:14:57 +02:00
enjoy-digital 27f00851d0
Merge pull request #447 from antmicro/spi-xip
Add initial support for the new LiteSPI core
2020-04-01 16:51:29 +02:00
Piotr Binkowski 81be74a7b1 targets: netv2: add LiteSPI 2020-04-01 16:20:36 +02:00
Piotr Binkowski 946cb16429 platform: netv2: update SPI flash pinout 2020-04-01 16:20:36 +02:00
Piotr Binkowski 31fceb0a10 litex_sim: add LiteSPI 2020-04-01 16:20:36 +02:00
Florent Kermarrec 91981b960c soc/cores/uart: use reset_less on accumulator, reg, bitcount to reduce.
This reduces logic a bit. It does not make large difference on usual design with
only 1 UART, but is interesting on designs with hundreds of UARTs used to "document"
FPGA boards :) (similar to https://github.com/enjoy-digital/camlink_4k/blob/master/ios_stream.py)
2020-03-31 16:54:38 +02:00
Florent Kermarrec 87160059d3 soc/cores/spi_flash: add ECP5SPIFlash (non-memory-mapped). 2020-03-31 16:17:12 +02:00
enjoy-digital e3445f6cd9
Merge pull request #444 from ilya-epifanov/openocd-jtag-programmer
Added openocd jtagspi programmer, to be used with ECP5-EVN board
2020-03-28 12:58:08 +01:00
Ilya Epifanov 351551a041 Added openocd jtagspi programmer, to be used with ECP5-EVN board 2020-03-28 11:20:30 +01:00
Gabriel Somlo 8473ed567a software/bios: add spisdcardboot() to boot_sequence()
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-27 15:24:09 -04:00
Gabriel Somlo e9054ef65a software/libbase/spisdcard: add delay to goidle loop
In `spi_sdcard_goidle()`, insert a `busy_wait()` into the CMD55+ACMD41
loop to avoid exhausting the retry counter before the card has a chance
to be ready (required on the trellisboard, also tested OK on nexys4ddr).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-27 15:24:09 -04:00
Gabriel Somlo c6b6dee2e7 software/bios: factor out busy_wait() function
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-27 15:24:09 -04:00
Gabriel Somlo 540218b2d8 software/libbase/spisdcard: fix width of address parameter
Host address parameter types should match CPU word width, so
use `unsigned long` to be correct on both 32 and 64 bit CPUs.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-27 15:24:09 -04:00
Florent Kermarrec 2e48ab568b soc/cores/spi: make dynamic clk divider optional (can be enabled with add_clk_divider method) and only use it in add_spi_sdcard. 2020-03-27 18:44:48 +01:00
Florent Kermarrec 4abb3715d9 targets/add_constant: avoid specifying value when value is None (=default). 2020-03-26 09:45:19 +01:00
Florent Kermarrec 73b4347587 software/libbase/spisdcard: add USE_SPISDCARD_RECLOCKING define to easily disable reclocking. 2020-03-26 07:46:32 +01:00
Florent Kermarrec b509df8bb6 integration/soc/add_uart: add USB CDC support (with ValentyUSB core). 2020-03-25 19:07:06 +01:00
Florent Kermarrec 76872a7afb tools/litex_sim: simplify using uart_name=sim. 2020-03-25 19:06:37 +01:00
Florent Kermarrec 09a3ce0ee5 integration/soc/add_uart: add Model/Sim. 2020-03-25 18:56:58 +01:00
Florent Kermarrec 3f43c6a223 integration/soc/add_uart: cleanup. 2020-03-25 18:54:29 +01:00
Florent Kermarrec 5bcf730c77 build/tools: add replace_in_file function. 2020-03-25 16:36:53 +01:00
Florent Kermarrec ffe83ef0f3 tools/litex_term: use 64 bytes as default payload_lengh (work for all confniguration) and add small delay between frames for FT245 FIFO.
The delay still need to be investigated.
2020-03-25 09:31:51 +01:00
Florent Kermarrec 8f2e36927d bios/boot: update comments. 2020-03-25 09:21:28 +01:00
enjoy-digital 1746b57a1b
Merge pull request #437 from feliks-montez/bugfix/fix-serialboot-frames
flush rx buffer when bad crc and fix frame payload length
2020-03-25 09:18:31 +01:00
Florent Kermarrec 8d999081e3 boards/targets: update SDRAM to use new GENSDRPHY and new ECP5PLL phase support. 2020-03-24 20:04:18 +01:00
Florent Kermarrec 3eb08c7dd8 boards/platforms: remove versa_ecp3 (ECP3 no longer supported). 2020-03-24 20:02:57 +01:00
Florent Kermarrec eb64169521 build/lattice/diamond: remove ECP3 support. (ECP3 is not used and no longer interesting now that ECP5 has an open-source toolchain). 2020-03-24 19:36:57 +01:00
Florent Kermarrec bba5f1828b cores/clock/ECP5PLL: add phase support. 2020-03-24 19:09:05 +01:00
Florent Kermarrec 0123ccc893 build/lattice/common: change LatticeECPXDDROutputImpl from ECP3 to ECP5. 2020-03-24 19:08:38 +01:00
bunnie 5a402264d0 Fix off-by-one error on almost full condition for prefetch
This causes a DRC error on the Xilinx tools when the prefetch
lines setting is 1. Don't know why this wasn't caught earlier,
but it just popped up in CI.
2020-03-24 08:04:35 +01:00
Feliks ebdc38fc91 flush rx buffer when bad crc and fix frame payload length 2020-03-23 23:04:36 -04:00
Florent Kermarrec d62ef38c4b soc/doc/csr: allow CSRField.reset to be a Migen Constant. 2020-03-23 18:47:41 +01:00
Florent Kermarrec 4adac90d88 cpu/vexriscv/mem_map_linux: move main_ram to allow up to 1GB. 2020-03-23 15:35:33 +01:00
Florent Kermarrec 63ab2ba40c software/bios/boot/linux: move emulator.bin to main_ram and allow defining custom ram offsets. 2020-03-23 15:06:32 +01:00
Florent Kermarrec d998475498 targets: remove Etherbone imports. 2020-03-21 21:39:34 +01:00
Florent Kermarrec 3b04efbcae targets: switch to add_etherbone method. 2020-03-21 19:55:00 +01:00
Florent Kermarrec 5ad7a3b7df integration/soc: add add_etherbone method. 2020-03-21 19:54:36 +01:00
Florent Kermarrec d6b0819e4c integration/soc/add_ethernet: add name parameter (defaults to ethmac). 2020-03-21 19:36:31 +01:00
Florent Kermarrec 930679efd7 targets: always use sys_clk_freq on SDRAM modules. 2020-03-21 19:36:06 +01:00
Florent Kermarrec ae6ef923af targets: fix typos in previous changes. 2020-03-21 18:26:58 +01:00
enjoy-digital c547b2cc29
Merge pull request #436 from rob-ng15/master
Reclock spi sdcard access after initialisation
2020-03-21 09:26:25 +01:00
enjoy-digital 011773af8d
Merge pull request #435 from enjoy-digital/spi_master_clk_divider
soc/core/spi: add Clk Divider CSR (defaults to sys_clk_freq/spi_clk_f…
2020-03-21 09:25:37 +01:00
rob-ng15 2bf31a31da
Reclock spi sdcard access after initialisation
Depends upon https://github.com/enjoy-digital/litex/pull/435

After initialising the card, reclock the card, aiming for ~16MHz (divider is rounded up, as slower speed is safer), but a maximum of half of the processor speed.

Tested with the card being clocked to 12.5MHz on de10nano
2020-03-21 07:37:21 +00:00
Florent Kermarrec f03d862c06 targets: switch to add_ethernet method instead of EthernetSoC. 2020-03-20 23:46:15 +01:00
Florent Kermarrec 4e9a8ffe9c targets: switch to SoCCore/add_sdram instead of SoCSDRAM. 2020-03-20 22:02:36 +01:00
Florent Kermarrec 61c9e54a90 soc/core/spi: add Clk Divider CSR (defaults to sys_clk_freq/spi_clk_freq). 2020-03-20 19:49:42 +01:00
Florent Kermarrec dd7718b4fe targets/arty: use new ISERDESE2 MEMORY mode. 2020-03-20 18:58:31 +01:00
Florent Kermarrec fca52d110d Merge branch 'master' of http://github.com/enjoy-digital/litex 2020-03-20 18:54:51 +01:00
rob-ng15 f3c233776e
Use <stdint.h> to provide structure sizes 2020-03-20 11:35:05 +00:00
rob-ng15 c2ebbcbf6c
Use <stdint.h> for structure sizes 2020-03-20 11:34:24 +00:00
Florent Kermarrec ccf7363932 integration/soc: add add_spi_flash method to add SPI Flash support to the SoC. 2020-03-20 10:24:31 +01:00
Florent Kermarrec ec3e068669 targets/nexys4ddr: use LiteXSoC's add_spi_sdcard method. 2020-03-20 09:58:09 +01:00
Florent Kermarrec d276036f24 integration/soc: add add_spi_sdcard method to add SPI mode SDCard support to the SoC. 2020-03-20 09:57:37 +01:00
enjoy-digital 6044570928
Merge pull request #433 from gsomlo/gls-rocket-spisdcard
Support SPI-mode SDCard booting on Litex+Rocket (64bit) configuration
2020-03-20 09:41:56 +01:00
Gabriel Somlo b960d7c574 targets/nexys4ddr: add '--with-spi-sdcard' build option 2020-03-19 21:51:44 -04:00
Gabriel Somlo 7a7b8905b7 platforms/nexys4ddr: add spisdcard pins.
Synchronize with litex-boards commit #57bcadb.
2020-03-19 21:51:44 -04:00
Gabriel Somlo af4de03fad targets/nexys4ddr: make sdcard reset conditional 2020-03-19 21:51:44 -04:00
Gabriel Somlo a33916bc6b software/libbase/spisdcard: fix 4-byte FAT fields on 64-bit CPUs
On 64-bit architectures (e.g., Rocket), 'unsigned long' means
eight (not four) bytes. Use 'unsigned int' wherever a FAT data
structure requires a four-byte field!

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-19 21:51:44 -04:00
Piotr Esden-Tempski 279886721b Don't let python convert lane number to float.
While at it also:
* Don't multilane for reg >= 8 bit width.
* Only check if we should switch to multilane after finding min field width.
2020-03-19 18:12:41 -07:00
Gabriel Somlo 1f90abea8e bios: make SPI SDCard boot configs other than linux-on-litex-vexriscv
When NOT on linux-on-litex-vexriscv, we load 'boot.bin' to MAIN_RAM_BASE,
and jump to it.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-19 19:37:47 -04:00
Gabriel Somlo c2938dc973 bios/boot.c: cosmetic: re-indent spisdcardboot() for consistency 2020-03-19 19:37:47 -04:00
enjoy-digital dd07a0ad2f
Merge pull request #431 from antmicro/hybrid-mac
litex_sim: add support for hybrid mac
2020-03-19 22:10:33 +01:00
Florent Kermarrec 37f25ed37a software/libbase/bios: rename spi.c/h to spisdcard.h, also rename functions. 2020-03-19 11:02:15 +01:00
Florent Kermarrec 939256340f software/bios/main: revert USDDRPHY_DEBUG (merge issue with SPI SD CARD PR). 2020-03-19 10:47:28 +01:00
enjoy-digital 8fe9e72f7b
Merge pull request #429 from rob-ng15/master
SPI hardware bitbanging from SD CARD
2020-03-19 10:41:09 +01:00
Piotr Binkowski 96a265a408 litex_sim: add support for hybrid mac 2020-03-19 10:04:08 +01:00
Gabriel Somlo b2103f4ad8 bios/sdcard: provide sdclk_set_clk() stub for clocker-less targets
Targets which lack an adjustable clocker will not expose the required
registers. Provide a stub sdclk_set_clk() routine for those situations.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-18 15:11:23 -04:00
Florent Kermarrec e865162904 platforms/kcu105: fix pcie tx0 p/n swap. 2020-03-18 19:05:54 +01:00
rob-ng15 27720409ce
SPI hardware bitbanging from SD CARD 2020-03-17 09:51:11 +00:00
rob-ng15 d45dda731a
SPI hardware bitbanging from SD CARD 2020-03-17 09:50:45 +00:00
rob-ng15 50b6db6a6b
SPI hardware bitbanging from SD CARD 2020-03-17 09:50:16 +00:00
Florent Kermarrec 2c4b89639f soc/cores/clock: make sure specific clkoutn_divide_range is only used as a fallback solution. 2020-03-16 11:44:39 +01:00
Piotr Esden-Tempski 57576fa8fc Add bit more logic to decide when to switch to multilane CSR documentation.
Now we only generate multilane bitfield documentation when the CSR has
fields, and the smallest field is less than 8bit long. As this is when
we start running into space problems with the field names.
2020-03-13 14:48:56 -07:00
Piotr Esden-Tempski dda7a8c5f3 Split CSR documentation diagrams with more than 8 bits into multiple lanes.
In cases when each CSR bit has a name and we use CSR with more than 8
bits, the register diagram quickly becomes crowded and hard to read.

With this patch we split the register into multiple lanes of 8 bits
each.
2020-03-13 14:48:23 -07:00
Florent Kermarrec aec1bfbeb4 cores/clock: simplify Fractional Divide support on S7MMCM.
Specific clkoutn_divide_range can now be provided by specialized XilinxClocking classes.
When provided, the specific range will be used. Floats are also now supported in the
range definition/iteration.
2020-03-13 15:56:39 +01:00
enjoy-digital f34593a17d
Merge pull request #421 from betrusted-io/clk0_fractional
add fractional division options to clk0 config on PLL
2020-03-13 14:15:24 +01:00
Florent Kermarrec eb9f54b2bc test: add initial (minimal) test for clock abstraction modules.
Also fix divclk_divide_range on S6DCM.
2020-03-13 12:38:23 +01:00
Florent Kermarrec c304c4db27 targets/icebreaker: add description of the board, link to crowdsupply campagin and to the more complete example. 2020-03-13 09:37:42 +01:00
Piotr Esden-Tempski d063acb767 Updating the vendored wavedrom js files. 2020-03-12 22:35:04 -07:00
Florent Kermarrec a27385a79c soc/intergration: rename mr_memory_x parameter to memory_x. 2020-03-12 12:20:48 +01:00
Piotr Esden-Tempski 4d02263223 Add --mr-memory-x parameter to generate memory regions memory.x file.
This file is used by rust embedded target pacs.
2020-03-11 18:12:18 -07:00
Florent Kermarrec e9f0ff68ce Merge branch 'master' of http://github.com/enjoy-digital/litex 2020-03-11 12:57:29 +01:00
Florent Kermarrec 979f98ea31 software: revert LTO changes (Disable it).
It seems LTO is not yet fully working with all configurations, so it's better
reverting the changes for now.
- cause issues with LM32 available compilers.
- seems to cause issues with min/lite variant of VexRiscv.
- seems to cause issues with some litex-buildenv configurations. (see https://github.com/enjoy-digital/litex/issues/417).
2020-03-11 12:57:00 +01:00
Sean Cross 01b6969375
Merge pull request #422 from xobs/core-doc-fixes
Core doc fixes
2020-03-11 19:38:42 +08:00
enjoy-digital 4ccf62afc1
Merge pull request #423 from gsomlo/gls-ethmac-fixes
integration/soc: add_ethernet: honor self.map["ethmac"], if present
2020-03-11 12:33:50 +01:00
Florent Kermarrec bb8905fa5d cores/gpio: add CSR descriptions. 2020-03-11 12:06:15 +01:00
Florent Kermarrec 4dabc5a625 cores/icap: add CSR descriptions. 2020-03-11 11:04:42 +01:00
Florent Kermarrec 77132a48b0 cores/spi: add CSR descriptions. 2020-03-11 10:58:32 +01:00
Florent Kermarrec 6d861c6e57 cores/pwm: add CSR descriptions. 2020-03-11 10:38:28 +01:00
Florent Kermarrec cbc1f5949d cores/xadc: add CSR descriptions. 2020-03-11 10:05:14 +01:00
Gabriel Somlo a904034811 integration/soc: add_ethernet: honor self.map["ethmac"], if present
Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-10 19:49:34 -04:00
Florent Kermarrec 846a2720b7 targets/kcu105: move cd_pll4x. 2020-03-10 17:02:28 +01:00
Florent Kermarrec c97fabb285 targets/kcu105: simplify CRG using USIDELAYCTRL. 2020-03-10 16:48:07 +01:00
Florent Kermarrec 3c0b97eec8 cores/clock/USIDELAYCTRL: use separate reset/ready counters and set cd_sys.rst internally.
This is the behaviour that was duplicated in each target. Integrating it here
will allow simplifying the targets.
2020-03-10 16:46:54 +01:00
Sean Cross a2f61b4e80 soc/cores/spi_opi: documentation fixes
The ModuleDoc-generated documentation for the spi_opi module produced
slightly invalid output due to ambiguities in how rst assigns headers.
As a result, sections from the spi_opi document would appear as full
sections.

This cleans up these errors so that it parses properly under sphinx.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-10 20:40:04 +08:00
Sean Cross d2f6139dc7 soc/cores/i2s: fix rst parsing errors
The ModuleDoc-generated documentation for the i2s module produced
slightly invalid output due to ambiguities in how rst assigns headers.
As a result, sections from the i2s document would appear as full
sections.

This cleans up these errors so that it parses properly under sphinx.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-03-10 20:37:55 +08:00
Florent Kermarrec bcbf558b6b bios: add more Ultrascale SDRAM debug with sdram_cdly command to set clk/cmd delay. 2020-03-10 13:08:49 +01:00
bunnie 5b92bf2d57 add fractional division options to clk0 config on PLL
S7 MMCMs allow fractional divider on clock 0. Add a fallback
to try fractional values on clock 0 if a solution can't be found.

This is necessary for e.g. generating both a 100MHz and 48MHz
clock from a 12MHz source with margin=0
2020-03-10 18:48:30 +08:00
enjoy-digital c4ce6da6c8
Merge pull request #419 from gsomlo/gls-ultra-sdram-fixup
software/bios: fixup for Ultrascale SDRAM debug
2020-03-10 11:43:23 +01:00
Florent Kermarrec b509068790 cores/clock: add logging to visualize clkin/clkouts and computed config. 2020-03-10 11:13:16 +01:00
Florent Kermarrec 04b8a91255 integration/soc: add FPGA device and System clock to logs. 2020-03-10 11:10:23 +01:00
Florent Kermarrec 02cba41d64 targets/icebreaker: create CRG after SoC. 2020-03-10 11:09:56 +01:00
Gabriel Somlo 4d15e1f7f8 software/bios: fixup for Ultrascale SDRAM debug
Keep CSR accesses independent of csr_data_width and csr_alignment.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-03-09 15:32:08 -04:00
Florent Kermarrec ba2f31d43d integration/soc: set use_rom when cpu_reset_address is defined in a rom region. 2020-03-09 19:36:47 +01:00
Florent Kermarrec 8808c884c5 boards/platforms/icebreaker: cleanup a bit. 2020-03-09 19:16:02 +01:00
Florent Kermarrec 4656b1b2ad software/common: fix LTO checks. 2020-03-09 19:08:27 +01:00
Florent Kermarrec 2a91deadcb soc/cores/clock/iCE40PLL: add SB_PLL40_PAD support. 2020-03-09 19:03:05 +01:00
Florent Kermarrec 38d7f8a6e6 build/lattice/icestorm: add timingstrict parameter and default to False. (similar behavior than others backends) 2020-03-09 19:02:23 +01:00
Florent Kermarrec 1e9aa64387 targets/icebreaker: simplify, use standard VexRiscv, add iCE40PLL and run BIOS from SPI Flash. 2020-03-09 19:01:16 +01:00
Florent Kermarrec 197bdcb026 lattice/icestorm: enable DSP inference with Yosys and avoid setting SPI Flash in deep sleep mode after configuration which prevent running ROM CPU code from SPI Flash. 2020-03-09 16:51:18 +01:00
Florent Kermarrec 37869e38b8 boards: add initial icebreaker platform/target from litex-boards. 2020-03-09 11:56:55 +01:00
Florent Kermarrec 72af1b39eb software/bios: add Ultrascale SDRAM debug functions. 2020-03-09 10:55:31 +01:00
Florent Kermarrec 6480d1803e boards/platforms/kcu105: avoid unnecessary {{}} on INTERNAL_VREF. 2020-03-09 09:37:31 +01:00
Florent Kermarrec b02c23391a integration/soc/SoCRegion: add size_pow2 and use this internally for checks since decoder is using rounded size to next power or 2. 2020-03-08 19:17:31 +01:00
Florent Kermarrec e801dc0261 soc: allow creating SoC without BIOS.
By default the behaviour is unchanged and the SoC will provide a ROM:
./arty.py

Bus Regions: (4)
rom                 : Origin: 0x00000000, Size: 0x00008000, Mode: R, Cached: True Linker: False
sram                : Origin: 0x01000000, Size: 0x00001000, Mode: RW, Cached: True Linker: False
main_ram            : Origin: 0x40000000, Size: 0x10000000, Mode: RW, Cached: True Linker: False
csr                 : Origin: 0x82000000, Size: 0x00010000, Mode: RW, Cached: False Linker: False

The integrated rom can be disabled with:
./arty.py --integrated-rom-size=0

but the SoC builder will check for a user provided rom, and if not provided will complains:
ERROR:SoC:CPU needs rom Region to be defined as Bus or Linker Region.

When a rom is provided, the CPU will use the rom base address as cpu_reset_address.

If the user just wants the CPU to start at a specified address without providing a rom,
the cpu_reset_address parameter can be used:

./arty.py --integrated-rom-size=0 --cpu-reset-address=0x01000000

If the provided reset address is not located in any defined Region, an error will
be produced:
ERROR:SoC:CPU needs reset address 0x00000000 to be in a defined Region.

When no rom is provided, the builder will not build the BIOS.
2020-03-06 20:05:27 +01:00
Florent Kermarrec ecca3d801d integration/builder: rename software methods to _prepare_rom_software/_generate_rom_software/_initialize_rom_software. 2020-03-06 14:53:59 +01:00
Florent Kermarrec 69ffafd81d integration/builder: generate csr maps before compiling software. 2020-03-06 14:20:32 +01:00
Florent Kermarrec e2dab06386 Add SVD export capability to Builder (csr_svd parameter) and targets (--csr-svd argument) and fix svd regression.
This allows generating SVD export files during the build as we are already doing for .csv or .json.

Use with Builder:
builder = Builder(soc, csr_svd="csr.svd")

Use with target:
./arty.py --csr-svd=csr.svd
2020-03-06 14:12:58 +01:00
Florent Kermarrec e124aed9a2 software/common.mak: fix LTO refactoring issue. 2020-03-05 23:42:36 +01:00
Karol Gugala da580e31fd Fix copyrights
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-03-05 17:44:10 +01:00
Gabriel Somlo 020bef4197 targets/nexys4ddr: fix sdcard clocker initialization 2020-03-05 09:02:29 -05:00
enjoy-digital 9249fc90cf
Merge pull request #410 from antmicro/netv2-edid
platform/netv2: add proper I2C pins for HDMI IN0
2020-03-05 11:43:02 +01:00
Piotr Binkowski 72f63243cd platform/netv2: add proper I2C pins for HDMI IN0 2020-03-05 11:27:47 +01:00
Florent Kermarrec ad11ff39ad targets/ecp5: make sure all BaseSoC/EthernetSoc default to trellis. 2020-03-05 11:19:29 +01:00
Florent Kermarrec 3770195048 bios/sdcard: update sdclk_mmcm_write with LiteSDCard clocker changes. 2020-03-04 18:33:08 +01:00
Florent Kermarrec 4c83c975b1 doc: align to improve readability. 2020-03-04 16:46:56 +01:00
Florent Kermarrec 4f935714de soc/doc: remove soc.get_csr_regions support.
Now that SoC documentation is integrated in LiteX, this is no longer needed.
2020-03-04 16:27:11 +01:00
Florent Kermarrec 6893222cf1 bios/main: rename flushl2 command to flush_l2_cache, add flush_cpu_dcache command and expose them in help. 2020-03-04 15:53:18 +01:00
Florent Kermarrec 0b923aa497 build: assume vendor tools are in the PATH and remove automatic sourcing, source and toolchain_path parameters.
Automatic sourcing was not consistent between build backends (and only really supported by ISE/Vivado)
and had no real additional value vs the complexity needed to support it. Now just assume required vendor
tools are in the PATH.

This also removes distutils dependency.
2020-03-04 09:13:26 +01:00
Florent Kermarrec 1d7c6943af software/common: add LTO enable flag and cleanup. 2020-03-04 08:11:21 +01:00
Florent Kermarrec b29f443fe5 litex_sim: fix with_uart parameter. 2020-03-03 19:04:18 +01:00
Florent Kermarrec 98e41e2e0d targets/nexys4ddr: add default kwargs parameters. 2020-03-02 09:44:20 +01:00
Florent Kermarrec 598ad692a0 Merge branch 'master' of https://github.com/enjoy-digital/litex 2020-03-02 09:31:45 +01:00
Florent Kermarrec a67e19c660 integration/soc_core: change disable parameters to no-xxyy. 2020-03-02 09:31:32 +01:00
enjoy-digital ddb264f3fd
Merge pull request #405 from sajattack/sifive-triple
add riscv-sifive-elf triple
2020-03-02 09:30:05 +01:00
Florent Kermarrec 156a85b15b integration/soc: add auto_int type and use it on all int parameters.
Allow passing parameters as int or hex values.
2020-03-02 09:08:30 +01:00
Florent Kermarrec 7e96c911b9 targets/nexys4ddr: use SoCCore and add_sdram to avoid use of specific SoCSDRAM. 2020-03-02 09:01:05 +01:00
Florent Kermarrec cb0371b330 integration/soc: add ethphy CSR in target. 2020-03-02 08:42:59 +01:00
Florent Kermarrec f27225c2de targets/nexys4ddr: use soc.add_ethernet method. 2020-03-01 21:21:01 +01:00
Florent Kermarrec 9735bd5bf2 integration/soc: add add_ethernet method. 2020-03-01 20:50:13 +01:00
Florent Kermarrec 1c74143a39 integration/soc: mode litedram imports to add_sdram, remove some separators. 2020-03-01 18:58:55 +01:00
Paul Sajna 68c013d13f add riscv-sifive-elf triple 2020-03-01 01:39:03 -08:00
Florent Kermarrec 59e99bfbcd soc/uart: add configurable UART FIFO depth. 2020-02-28 22:34:11 +01:00
Florent Kermarrec 9199306a65 cores/uart: cleanup 2020-02-28 22:12:05 +01:00
Florent Kermarrec ea8563339f soc/cores/uart/UARTCrossover: reduce fifo_depth to 1. 2020-02-28 22:03:40 +01:00
Florent Kermarrec 12a7528667 interconnect/stream/SyncFIFO: allow depth down to 0. 2020-02-28 21:54:02 +01:00
Florent Kermarrec 9e31bf357e interconnect/axi: remove Record inheritance on AXIInterface/AXILiteInterface. 2020-02-28 16:33:18 +01:00
Florent Kermarrec 1e0e96f9a0 interconnect/axi: add AXI Stream definition and get_ios/connect_to_pads methods. 2020-02-28 16:25:09 +01:00
Florent Kermarrec 6be7e9c33d interconnect/axi: set default data_width/address_width to 32-bit. 2020-02-28 13:20:01 +01:00
Florent Kermarrec 8e1d528663 targets: default to trellis toolchain on all ECP5 targets (now able to build all supported targets). 2020-02-28 09:48:48 +01:00
Florent Kermarrec a7c5dd5d3e cores/gpio: use separate TSTriple for each bit.
This fixes per bit OE control.
2020-02-28 09:10:28 +01:00
Florent Kermarrec 400492e234 lattice/yosys: don't use quiet operation since logs are useful and for consistency with others build backends. 2020-02-28 08:32:29 +01:00
Florent Kermarrec c4fd6a7f2f targets/kc705: use DDRPHY_CMD_DELAY to center write leveling. 2020-02-27 13:00:35 +01:00
Florent Kermarrec 78a3223573 software/bios/sdram: allow setting CLK/CMD delay from user design and configure it before write/read leveling.
Setting a manual delay on CLK/CMD vs DQ/DQS is required on some configuration to center the write leveling window:

Before (delay = 0 taps):
Write leveling:
m0: |11000000000000011111111111| delay: 15
m1: |00000000000000111111111111| delay: 14
m2: |11110000000000000111111111| delay: 17
m3: |11110000000000000011111111| delay: 18
m4: |11111111110000000000000111| delay: 00
m5: |11111111110000000000000111| delay: 00
m6: |11111111111000000000000001| delay: 00
m7: |11111111111000000000000011| delay: 00

After (delay = 12 taps):
Write leveling:
m0: |11111111111111000000000000| delay: 00
m1: |11111111111100000000000001| delay: 00
m2: |00011111111111110000000000| delay: 03
m3: |00011111111111110000000000| delay: 03
m4: |00000000111111111111110000| delay: 08
m5: |00000000111111111111110000| delay: 08
m6: |00000000001111111111111000| delay: 10
m7: |00000000001111111111111000| delay: 10
2020-02-27 12:26:27 +01:00
Florent Kermarrec eab5161d47 boards: keep in sync with LiteX-boards 2020-02-27 11:18:14 +01:00
Florent Kermarrec 935e4effd2 interconnect/axi: remove mode on AXIInterface (not used and breaking LiteDRAM tests) 2020-02-26 15:13:29 +01:00
Florent Kermarrec d324c54eee integration/soc: -x on soc.py 2020-02-26 14:43:01 +01:00
Florent Kermarrec ee27a9e534 soc/cores/bitbang: fix missing self.comb on miso. 2020-02-25 15:57:14 +01:00
enjoy-digital a2d6986910
Merge pull request #402 from antmicro/litex-gen-fix-uart-pins
tools: litex_gen: fix missing UART pins
2020-02-25 15:53:13 +01:00
Florent Kermarrec e2aebb427e software: disable LTO with LM32 (not supported by old GCC versions easily available). 2020-02-25 15:32:36 +01:00
Jan Kowalewski 75b000a32f tools: litex_gen: fix missing UART pins 2020-02-25 14:24:29 +01:00
Tim 'mithro' Ansell 718a65c3c9 software: enable link time optimization (LTO)
Co-authored-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
2020-02-24 16:12:21 +01:00
Xiretza 7a87d4e262
Fix ECP5PLL VCO frequency range
See https://www.latticesemi.com/view_document?document_id=50461 ("ECP5
and ECP5-5G Family Data Sheet"), section 3.19 "sysCLOCK PLL Timing".
2020-02-24 14:39:59 +01:00
Florent Kermarrec 0c7e0bf025 integration/soc: improve presentation of SoCLocHandler's locations. 2020-02-24 13:37:38 +01:00
Florent Kermarrec 0042a02807 interconnect/axi: remove bus_name on connect_to_pads 2020-02-24 13:24:32 +01:00
Florent Kermarrec 5aba1fe824 tools/litex_gen: add bus parameter and AXI (Lite) support. 2020-02-24 12:49:42 +01:00
Florent Kermarrec a3584147a5 litex_gen/axi: simplify the way the bus is exposed as ios and connected to pads. 2020-02-24 12:48:52 +01:00
Florent Kermarrec d86db6f12b litex_gen/wishbone: simplify the way the bus is exposed as ios and connected to pads. 2020-02-24 12:48:20 +01:00
Florent Kermarrec 18c57a64a3 tools: rename litex_extract to litex_gen (use similar name than litedram/liteeth generators) and cleanup/simplify. 2020-02-24 10:25:18 +01:00
enjoy-digital 0083e0978b
Merge pull request #396 from antmicro/external-wb
Add a script that allows to generate standalone cores
2020-02-24 10:01:16 +01:00
Gabriel Somlo 173117ad4b Add 'volatile' qualifier to new CSR accessors
Through their use of the MMPTR() macro, the "classic"
csr_[read|write]simple() accsessors identify the MMIO
subregister with the 'volatile' qualifier.

Adjust the new, csr_[rd|wr]_uint[8|16|32|64]() accessors
to also utilize the 'volatile' qualifier. Since accesses
are implicit (a[i], where a is an 'unsigned long *'),
change 'a' to be a 'volatile unsigned long *' instead.

No difference was noticed in opcodes generated using the
gcc9 risc-v cross-compiler on x86_64 with standard LiteX
cflags (vexriscv and rocket were tested), but since
reports exist that 'volatile' matters on some combinations
of compilers and targets, add the 'volatile' qualifier just
to be on the safe side.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com
2020-02-21 14:10:13 -05:00
Piotr Binkowski 9e2aede8a8 tools: add script for extracting wishbone cores 2020-02-21 16:33:26 +01:00
Karol Gugala 79a14001b0 axi: add to_pads method
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2020-02-21 12:22:18 +01:00
Jan Kowalewski e0bcb57d3d wishbone: add extracting module signals to the top 2020-02-21 11:20:32 +01:00
Florent Kermarrec 53ee9a5e05 cpu/blackparrot: first cleanup pass 2020-02-20 18:50:13 +01:00
Florent Kermarrec f3829cf081 integration/soc: set base_address on LiteDRAMWishbone2Native, fix addressing with >= 1GB SDRAMs. 2020-02-20 16:16:36 +01:00
Florent Kermarrec 3a6f97fff3 build/sim: add Verilator FST tracing support. 2020-02-20 13:53:31 +01:00
Gabriel Somlo 516cf40506 targets/nexys4ddr: add optional sdcard support
Add the option to select LiteSDCard support in BaseSoC, via the
'--with-sdcard' command line argument.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-02-19 20:16:13 -05:00
Gabriel Somlo d4d2b7f7c6 bios: add litesdcard test routines to boot menu
This is a straightforward import of the sdcard initialization and
testing routines from the LiteSDCard demo example, made available
as mainline LiteX bios boot-prompt commands.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-02-19 20:16:13 -05:00
Gabriel Somlo 7a2e33b817 targets/nexys4ddr: add ethernet via method instead of inheritance
Switch adding LiteETH support to BaseSoc via a method instead of
inheritance. This allows further optional peripherals to be added
in the future, via additional methods.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-02-19 20:16:13 -05:00