Commit Graph

1612 Commits

Author SHA1 Message Date
Florent Kermarrec 1c465f89b6 build/lattice: add add_false_path_constraint method for API compatibility but false paths are not yet used/translated to .lpf file 2020-01-17 10:17:19 +01:00
Florent Kermarrec b4ba2a47ef soc/cores/uart: set rx_fifo_rx_we to True on UARTCrossover 2020-01-17 06:32:00 +01:00
sadullah d15c911cac BlackParrot initial commit
w/ Litex BIOS simulation including LiteDRAM
w/ Litex BIOS working on FPGA excluding LiteDRAM
2020-01-16 19:13:02 -05:00
Florent Kermarrec 5aa516cb8d soc/cores/uart: add rx_fifo_rx_we parameter to pulse rx_fifo.source.ready on rxtx register read.
When UARTCrossover is used over Etherbone, acking data directly with the read avoid the write/read round-trip
and speed up communication a lot (>10x).
2020-01-16 19:45:41 +01:00
Florent Kermarrec 862e784eae cpu/vexriscv: use 32-bit signal for externalResetVector 2020-01-16 16:20:25 +01:00
Florent Kermarrec f2a1673f46 targets/arty/genesys2: fix EthernetSoC/EtherboneSoC selection 2020-01-16 13:17:33 +01:00
Florent Kermarrec 990870d061 targets/genesys2: add EtherboneSoC 2020-01-16 12:32:59 +01:00
Florent Kermarrec 820e79bf9c platforms/de0nano: specify gpio for serial 2020-01-16 12:32:25 +01:00
Florent Kermarrec ba366d42d0 targets: cleanup EthernetSoC 2020-01-16 10:14:42 +01:00
Florent Kermarrec a26853702c soc/interconnect/packet/Depacketizer: use both sink.valid and sink.ready to update sink_d, fix Etherbone regression on Arty. 2020-01-16 09:46:54 +01:00
Florent Kermarrec a168ecbabd targets/arty: add EtherboneSoC 2020-01-16 09:11:44 +01:00
Florent Kermarrec 7a4ecfa59d targets/kcu105: update 2020-01-15 13:17:59 +01:00
Florent Kermarrec 42efa99826 SoCCore: set default integrated_rom/ram_size to 0. For targets, defaults values are provided by soc_core_args. 2020-01-15 10:59:01 +01:00
Florent Kermarrec 4050e60834 SoCCore: use hex for integrated_rom/sram_size 2020-01-13 20:01:45 +01:00
enjoy-digital f818755c9c
Merge pull request #339 from gsomlo/gls-csr-cleanup
CSR Improvements and Cleanup
2020-01-13 19:57:59 +01:00
Florent Kermarrec f1606dbc72 tools/litex_sim: use default integrated_rom_size 2020-01-13 17:39:23 +01:00
Florent Kermarrec 4648db0c2a cores/uart/UARTInterface: remove connect method 2020-01-13 16:58:00 +01:00
Florent Kermarrec 6c9f418d26 soc_core: fix uart stub 2020-01-13 16:56:31 +01:00
Gabriel Somlo b073ebadf6 bios/sdram: switch to updated CSR accessors, and misc. cleanup
Revert to treating SDRAM_DFII_PIX_[RD|WR]DATA CSRs as arrays
of bytes, but use the new uintX_t array accessors for improved
legibility, and to avoid unnecessary byteswapping.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-01-13 10:09:02 -05:00
Gabriel Somlo 2c39304110 software, integration/export: rename and reimplement CSR accessors
Implement CSR accessors for all standard integer types and
combinations of subregister alignments (32 or 64 bit) and
sizes (i.e., csr_data_width 8, 16, or 32).

Rename accessors to better reflect the size of the register
being accessed, and correspondingly update the generation
of "csr.h" in "export.py".

Additionally, provide read/write accessors that superimpose arrays
of standard unsigned C types over a CSR register (which may itself
be spread across multiple subregisters).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-01-13 10:09:02 -05:00
Florent Kermarrec 63cd23c9c3 cpu/vexriscv: revert mem_map_linux/main_ram 2020-01-13 16:02:32 +01:00
Florent Kermarrec 83a7225ccc SoCCore: set integrated rom/sram size default values in soc_core_args and use it in targets 2020-01-13 15:03:36 +01:00
Florent Kermarrec 6e3f25a7e0 cpu/vexriscv/mem_map_linux: update main_ram to 0x40000000 2020-01-13 14:40:26 +01:00
Florent Kermarrec fe14b9cf86 targets/genesys2: update self.register_sdram 2020-01-13 14:39:45 +01:00
Florent Kermarrec 39ce39a298 soc_sdram: add l2_data_width parameter to set minimal l2_data_width to improve DRAM accesses efficiency. 2020-01-13 13:00:17 +01:00
Florent Kermarrec 23175190d8 cores/uart: add UARTCrossover 2020-01-13 10:14:38 +01:00
Florent Kermarrec 2f03d3234e cores/uart/UART: add stream interface (phy=None), add connect method and use this for UART Stub/Crossover.
A bridged/crossover UART can now just be created by:
- passing uart_name="stream" to SoCCore/SoCSDRAM.
- adding a crossover UART core to the design:

# UART Crossover (over Wishbone Bridge
from litex.soc.cores.uart import UART
self.submodules.uart_xover = UART(tx_fifo_depth=2, rx_fifo_depth=2)
self.add_csr("uart_xover")
self.comb += self.uart.connect(self.uart_xover)
2020-01-13 09:20:40 +01:00
Florent Kermarrec d92bd8ffaa gen/fhdl/verilog: fix signed init values 2020-01-12 22:06:35 +01:00
enjoy-digital ff066a5e09
Merge pull request #338 from DurandA/master
Add optional 'ignore-loops' flag to nextpnr
2020-01-12 21:18:23 +01:00
Florent Kermarrec 26fe45fce1 cores/uart: rename BridgedUART to UARTEmulator and rework/simplify it. Also integrated it in SoCCore with uart_name="emulator" 2020-01-12 21:13:02 +01:00
Sean Cross 5079a3c32e uart: add BridgedUart
This version of the UART adds a second, compatible UART after
the first.  This maintians software compatibility, and allows a
program running on the other side of the litex bridge to act as
a terminal emulator by manually reading and writing the second
UART.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-01-12 19:52:42 +10:00
Arnaud Durand d24a4b5428 Add optional 'ignore-loops' flag to nextpnr 2020-01-10 16:07:56 +01:00
Florent Kermarrec f70dd48279 bios/sdram: add memspeed 2020-01-10 14:25:46 +01:00
Florent Kermarrec fa22d6aa82 wishbone/Cache: avoid REFILL_WRTAG state to improve speed. 2020-01-10 14:25:07 +01:00
Florent Kermarrec f408527dd4 soc/cores/cpu: add riscv64-linux toolchain support for risc-v cpus.
Toolchain can be downloaded from https://toolchains.bootlin.com/
2020-01-10 08:49:34 +01:00
Florent Kermarrec 8889821c54 targets: sync with litex-boards 2020-01-09 21:12:00 +01:00
Florent Kermarrec aba8fc5c94 build/altera/quartus: allow multiple call of add_period_constraint if constraint is similar.
Similar to the changes already applied to Xilinx backend.
2020-01-09 19:45:51 +01:00
enjoy-digital e318287ec2
Merge pull request #337 from gregdavill/spi-flash
soc/cores/spi_flash: Don't tristate DQ2/DQ3 when bitbanging
2020-01-09 13:24:17 +01:00
Greg Davill 49781467d7 soc/cores/spi_flash: Don't tristate DQ2/DQ3 when bitbanging 2020-01-09 21:53:00 +10:30
Florent Kermarrec 2cf95e9f93 platforms/minispartan6: rename sd to sdcard and regroup data lines 2020-01-09 11:12:37 +01:00
Florent Kermarrec e99740e814 platforms/nexys4ddr: add sdcard pins 2020-01-09 11:00:54 +01:00
Florent Kermarrec 83ad674feb build/lattice/trellis: use a single fonction to parse device 2020-01-08 19:38:27 +01:00
Konrad Beckmann 426ab676e8 trellis: Pass speed grade argument to nextpnr 2020-01-08 08:42:29 +01:00
enjoy-digital fd4cbd8053
Merge pull request #331 from betrusted-io/xadc_mods
WIP: add support for DRP on XADC
2020-01-06 18:09:12 +01:00
Florent Kermarrec 378722a7ef soc/cores/xadc: define analog_layout and simplify analog_pads connections 2020-01-06 16:28:48 +01:00
bunnie 87d456cae2 bring back analog_pads specifier, remove reset conditions on VP
For the "P" side of the analog channels, actually, connecting
a digital line to them has "no meaning". The docs say that
either you connect an analog pin to a pad, or vivado "ties it off
appropriately". I wish it were the case that tying a pin to 0 or 1
would actually connect it to a power or ground, because it means
that even in unipolar mode you have to burn two pins to break out
the signal of interest *and* the ground reference analog pad
(I thought I could just connect it to "0" and the pin would be
grounded, but that doesn't happen -- it's just ignored if it's
not wired to a pad).

For the pad specifier, is it OK to leave it with an optional
argument of analog_pads=None? I tried assigning to the
self.analog property after instantiation, but this doesn't
seem to work, the default values are preferred. It looks like
if you don't want to do the analog_pads= optional argument
the other way to do it would be to add code on the instiating
module that tampers with the properties of the instance directly,
but I think that's sort of ugly.

Also, I noticed you stripped out the layout specifier for
the analog_pads. I thought it would be nice to provide that
in the file, so the caller doesn't have to infer what the
pad layout is by reading the code...what's the motivation for
removing that?
2020-01-06 21:47:58 +08:00
Florent Kermarrec 642d073700 cpu/minerva: fix variant syntax warning 2020-01-05 21:04:27 +01:00
Florent Kermarrec 4dc0a61428 soc/core/xadc: cleanup, simplify and add expose_drp method - keep CSR ordering with older version, requested for software compatibility. - always enable analog capability (user will just not use it if not needed). - add expose_drp method (similar to clock.py) for cases where DRP is needed. 2020-01-05 09:13:14 +08:00
Gabriel Somlo d087e2e0af interconnect/csr_bus/SRAM: allow 64-bit alignment (on 64-bit CPUs)
Similarly to how CSRBank subregisters are aligned to the CPU word
width (see commit f4770219f), ensure SRAM word_bits are also aligned
to the CPU word width.

Additionally, fix the MMPTR() macro to access CSR subregisters as
CPU word (unsigned long) sized slices.

This fixes the functionality of the 'ident' bios command on 64-bit
CPUs (e.g., Rocket).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-01-03 16:36:42 -05:00
bunnie 5eec7432b8 fix a couple bugs in the DRP readout path
I'm now getting data out via DRP. Still some TODOs, but
progress.
2020-01-04 03:03:59 +08:00
bunnie 56ccaeebf0 add support for DRP on XADC
The design is backward-compatible in functionality for users
who don't want to use DRP. That is, on power on, the XADC will
scan the supply and temperature and store them in CSRs.

If drp_enable is set, the scanning stops, and the XADC is now
controlled by the DRP bus.

Wher drp_enable is reset, the XADC may return to an auto-sample
mode, but only if the internal registers are configured to do this.
If you return to drp_enable without, for example, turning on
the continuous sequence and setting which channels to check,
the results will be unpredictable (mostly either it'll scan just
once and stop, or it'll not scan all the channels, depending on
the register settings).

At this point, the backward compatibility was confirmed in testing,
the DRP API is still a work in progress as the application this
is being developed for needs to support fun stuff like real time
sampling of signals to a buffer.

Down the road, this block may have to be modified again to support an
output FIFO, so we're not railing the CPU trying to do real time
sampling of ADC data. This will probably be added as a True/False flag
of some sort in the parameter list, because the FIFO will be expensive
as far as BRAM goes to implement and applications that don't need the
FIFO buffer can probably use that BRAM for better things.
2020-01-04 00:25:09 +08:00
Florent Kermarrec 690de79d8b cpu/microwatt: reorder sources, add comments 2020-01-03 15:29:10 +01:00
Florent Kermarrec e36df2a6fb build/lattice/icestorm: increase similarities with trellis. 2020-01-02 10:26:33 +01:00
Florent Kermarrec 197edad34e soc/integration/soc_core/SoCController: specify initial reset value of scratch register in description 2020-01-02 09:41:47 +01:00
Florent Kermarrec b65a36e7e8 soc/integration/soc_core/SoCController: rephrase CSR descriptions a bit 2020-01-02 09:38:23 +01:00
Sean Cross c5aa929d4c cores: timer: clean up wording for timer documentation
This fixes some formatting errors with the timer documentation, such as
the lack of a space between the first and second sentences.  It also
fixes some grammar for documentation of various fields.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-01-02 16:24:12 +08:00
Sean Cross 2d75aee7e0 soc_core: ctrl: document registers
This adds a small amount of documentation to the three registers present
inside the `CTRL` module.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-01-02 15:37:45 +08:00
Sean Cross a251d71211 cores: timer: fix documentation formatting
The ReStructured Text used was not properly formatted, resulting in
confusing and broken output.  This corrects the output and lets it
format correctly when using sphinx.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-01-02 15:36:35 +08:00
Florent Kermarrec db7a48c05d soc/cores/clock: also allow margin=0 on iCE40PLL and ECP5PLL 2020-01-01 13:24:06 +01:00
bunnie 219bb7f294 add the possibility for a "precise" clock solution
If clocks and multipliers are planned well, we can have
a zero-error solution for clocks. Suggest to change < to <= in
margin comparison loop, so that a "perfect" solution is allowed
to converge.
2020-01-01 18:49:35 +08:00
Florent Kermarrec 9336fe1139 build/microsemi/libero_soc: update add_period_constraint behavior when clock is already constrainted. 2019-12-31 10:33:12 +01:00
Florent Kermarrec 3022f02b3f build/xilinx/vivado: update add_period_constraint behavior when clock is already constrainted. 2019-12-31 10:32:09 +01:00
Florent Kermarrec fe4eaf5860 build/lattice/icestorm/add_period_constraint: improve
- store period in ns.
- pass clocks to_build_pre_pack and do the convertion to MHz there.
- improve error message.
2019-12-31 10:30:09 +01:00
Florent Kermarrec 6b91e8827c soc/integration/builder: avoid try/except on LiteDRAM import, just check if SoC has an sdram and do the import if so 2019-12-31 09:58:26 +01:00
enjoy-digital 2157d0f332
Merge pull request #327 from zakgi/master
moving RAM offsets outside of CSR_ETHMAC define
2019-12-31 09:49:53 +01:00
Tim 'mithro' Ansell f0b5c67216 Allow specifying the same clock constraint multiple times.
(As long as the clock values actually match.)
2019-12-30 19:25:14 +01:00
Tim 'mithro' Ansell 8b955e6f69 Allow LiteX builder to be used without LiteDRAM. 2019-12-30 19:24:26 +01:00
Tim 'mithro' Ansell a738739acd Improve the invalid CPU type error message. 2019-12-30 16:10:57 +01:00
Florent Kermarrec 85ade2b3b3 build/xilinx/programmer: fix vivado_cmd when settings are sourced manually. 2019-12-30 10:07:08 +01:00
Giammarco Zacheo 39ae230b83 moving RAM offsets outside of CSR_ETHMAC define 2019-12-29 22:56:42 -08:00
enjoy-digital ffa7ca8f0b
Merge pull request #321 from gsomlo/gls-rocket-aximem-wide
cpu/rocket: variants with double (128b) and quad (256b) wide mem_axi
2019-12-21 21:31:04 +01:00
enjoy-digital e754c0555a
Merge pull request #319 from DurandA/feature-integer-attributes
Add integer attributes
2019-12-21 21:30:09 +01:00
Gabriel Somlo cd8feca574 cpu/rocket: variants with double (128b) and quad (256b) wide mem_axi
Various development boards' LiteDRAM ports may have native data
widths of either 64 (nexys4ddr), 128 (versa5g), or 256 (trellis)
bits. Add Rocket variants configured with mem_axi ports of matching
data widths, so that a point to point connection between the CPU's
memory port and LiteDRAM can be accomplished without any additional
data width conversion gateware.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-12-21 14:11:48 -05:00
Gabriel Somlo 585b50b292 soc_core: csr_alignment assertions
Enforce the condition that csr_alignment be either 32 or 64 when
requested explicitly when initializing SoCCore().

Additionally, if a CPU is specified, enforce that csr_alignment be
equal to the native CPU word size (currently either 32 or 64), and
warn the caller if an alignment value *higher* than the CPU native
word size was explicitly requested.

In conclusion, if a CPU is specified, then csr_alignment should be
assumed to equal 8*sizeof(unsigned long).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-12-21 13:00:40 -05:00
Gabriel Somlo b6818c205e cpu/rocket: access PLIC registers via pointer dereference
Since the PLIC is internal to Rocket, access its registers
directly via pointer dereference, rather than through the
LiteX CSR Bus accessors (which assume subregister slicing,
and are therefore inappropriate for registers NOT accessed
over the LiteX CSR Bus).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-12-21 12:59:19 -05:00
Florent Kermarrec 0e46913d52 cpu/microwatt: add initial software support 2019-12-20 23:32:21 +01:00
Arnaud Durand 94e239ff13 Add integer attributes 2019-12-19 09:03:12 +01:00
Arnaud Durand f8c5821658 Revert "gen/fhdl/verilog: allow single element verilog inline attribute"
This reverts commit b845755995.
2019-12-19 08:53:44 +01:00
Florent Kermarrec f883f0c703 cpu/microwatt: add submodule 2019-12-18 19:07:08 +01:00
Florent Kermarrec 5da0bcbd7a cpu/microwatt: set csr to 0xc0000000 (IO region) 2019-12-18 08:59:35 +01:00
Florent Kermarrec 39a8ebe70c cpu/microwatt: fix add_source/add_sources 2019-12-18 08:56:36 +01:00
Florent Kermarrec d74a7463e0 soc/cores/pwm: remove debug print(n) 2019-12-18 08:47:56 +01:00
Florent Kermarrec bd15f07cf7 platforms/netv2: add xc7a100t support 2019-12-17 09:47:31 +01:00
Florent Kermarrec 76e57414c3 platforms/minispartan6: add assert on available devices 2019-12-17 09:47:12 +01:00
Florent Kermarrec bfe0bf6402 cpu/microwatt: simplify add_sources 2019-12-17 09:41:46 +01:00
Florent Kermarrec b9edde20de cpu/microwatt: add io_regions and gcc_flags 2019-12-17 09:33:46 +01:00
Florent Kermarrec 16e7c6b634 cpu/microwatt: update copyright 2019-12-17 09:27:19 +01:00
Florent Kermarrec 3d79324fce cpu/microwatt: drive stall signal (no burst support) 2019-12-16 12:37:27 +01:00
Florent Kermarrec da3a178bc6 soc/cores/pwm: add clock_domain support 2019-12-16 11:13:10 +01:00
Florent Kermarrec 9da28c4ea5 build/xilinx/XilinxMultiRegImpl: fix n=0 case 2019-12-16 11:12:38 +01:00
Florent Kermarrec ec7dc2d8f4 build/xilinx/ise: cleanup/simplify pass, remove mist support (not aware of anyone using it) 2019-12-14 22:47:07 +01:00
Florent Kermarrec 1b963bb2d5 soc/cores/cpu: add initial Microwatt gateware support
Implementation tested on arty:
cd litex/soc/cores/cpu/microwatt
git clone https://github.com/antonblanchard/microwatt
mv microwatt sources

cd litex/boards/targets
./arty --cpu-type=microwatt --no-compile-gateware
2019-12-14 00:00:13 +01:00
Florent Kermarrec c34255d2ab soc/cores/cpu/minerva: add self.reset to i_rst 2019-12-14 00:00:07 +01:00
Gabriel Somlo a0dad1b071 soc_core: additional CSR safety assertions
Since csr_data_width=64 has probably never worked properly, remove
it as one of the possible options (to be fixed and re-added later).
Add csr_data_width=16, which has been tested and does work.

Additionally, ensure csr_data_width <= csr_alignment (we should not
attempt to create (sub)registers larger than the CPU's native word
size or XLen).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-12-12 13:14:16 -05:00
Florent Kermarrec fb6b0786b6 soc_core: remove static 16MB csr region allocation (use csr_address_width to allocate the correct size) 2019-12-12 12:41:47 +01:00
Florent Kermarrec b1a1e5e227 soc_core: add sort of CSR regions by origin (allow csr.h/csr.csv to be ordered by origin) 2019-12-12 11:27:56 +01:00
Florent Kermarrec 061d593de3 cores/8b10b: use real Memory for 6b5b table (to improve timings on ECP5) 2019-12-09 19:25:38 +01:00
Florent Kermarrec a0122f9863 build/xilinx/vivado: move build_script generation 2019-12-08 12:19:38 +01:00
Florent Kermarrec 18ff8f38d1 build/xilinx/vivado: cleanup/simplify 2019-12-08 12:08:17 +01:00
Florent Kermarrec 0931ccc919 build/lattice/icestorm: cleanup/simplify (and remove arachne-pnr support) 2019-12-07 22:11:17 +01:00
Florent Kermarrec b1b920531a build/xilinx/common/platform/programmer: cleanup pass 2019-12-06 22:23:04 +01:00
Florent Kermarrec edaa66bbed boards: add Lambdaconcept's PCIe Screamer (R02) 2019-12-06 18:20:59 +01:00
Florent Kermarrec a8635c48a4 targets/versa_ecp5: fix compilation with diamond 2019-12-06 16:15:08 +01:00
Florent Kermarrec 30a18808ad boards/targets: keep attributes are no longer needed since automatically added when applying constraints to signals. 2019-12-06 15:58:06 +01:00
Florent Kermarrec 23c33cfa99 build: automatically add keep attribute to signals with timing constraints.
Avoid having to specify it manually or eventually forget to do it and have a constraints that is not applied correctly.
2019-12-06 15:41:15 +01:00
Florent Kermarrec 4c9af635d2 build/altera/quartus: allow adding period constraints on nets and add optional additional sdc/qsf commands
Additional sdc/qsf commands can be added from the design like:
platform.sdc_additional_commands.append("create_clock ...")
platform.sdc_additional_commands.append("set_false_path ...")
2019-12-06 15:19:07 +01:00
Florent Kermarrec 22e6f5ac1d build/lattice/trellis: nextpnr now handle LPF timing constraints and multiple clock domains, freq_constraint is no longer needed. 2019-12-06 12:57:59 +01:00
Florent Kermarrec 8fb3f9a90d build/lattice: cleanup/simplify (no functional changes)
icestorm still need to be cleaned up
2019-12-06 12:54:52 +01:00
Florent Kermarrec 946478a71e build/lattice: cleanup/simplify 2019-12-06 12:13:20 +01:00
Florent Kermarrec 60edca2345 build/microsemi: cleanup/simplify (no functional change) 2019-12-06 12:12:43 +01:00
Florent Kermarrec 50fdc5ce41 build/altera: cleanup/simplify (no functional change)
Altera build backend was a bit messy and needed some cleanup to ease future maintenance and new features.
2019-12-06 11:08:46 +01:00
Tim Ansell b17dfafa55
Merge pull request #313 from mmicko/yosys_ise_flow_fix
Yosys - ISE flow fix
2019-12-05 19:05:44 -08:00
Florent Kermarrec 8d90f4e97b build/xilinx/vivado: use VHDL 2008 as default 2019-12-03 15:27:20 +01:00
Florent Kermarrec cfd17321e2 targets/nexys4ddr: remove MEMTEST_ADDR_SIZE limitation (no longer needed) 2019-12-03 10:11:15 +01:00
Florent Kermarrec 201d60f37a targets/netv2: switch to MVP DDR3 (K4B2G1646F instead of MT41J128M16) 2019-12-03 09:05:52 +01:00
Florent Kermarrec 6b82064723 targets: uniformize, improve presentation 2019-12-03 08:58:01 +01:00
Florent Kermarrec 6de20f185a soc/interconnect/csr: add fields support for CSRStorage's write simulation method 2019-12-02 09:44:44 +01:00
Florent Kermarrec 2567a0ae1d soc/cores/gpio: add GPIO Tristate 2019-12-01 21:26:37 +01:00
Konrad Beckmann f411d6d362 trellis: Support the CABGA256 package 2019-11-30 02:50:41 +01:00
Miodrag Milanovic 783dfa508c Properly select family for those currently supported 2019-11-29 19:11:22 +01:00
Miodrag Milanovic 6560911df2 Integrate with latest yosys changes 2019-11-29 17:12:08 +01:00
Sean Cross 581c23725e spi_flash: correct documentation on SPI mode
The SPI mode is actually mode3, since the output value is updated on the
falling edge of CLK and the input value is updated on the rising edge.

This also clarifies some of the documentation based on experience with
the core.

Signed-off-by: Sean Cross <sean@xobs.io>
2019-11-25 12:35:13 +08:00
Florent Kermarrec de205d4a84 tools/remote/comm_udp: only use one socket 2019-11-22 15:28:35 +01:00
Florent Kermarrec bdaca40fe4 build/generic_platform: avoid duplicate in GenericPlatform.sources 2019-11-22 15:28:07 +01:00
Florent Kermarrec 6883a43680 soc/cores/clock: change drp_locked to CSRStatus and connect it :) 2019-11-20 19:37:16 +01:00
Florent Kermarrec 36107cdfd7 soc/cores/clock: reset PLL/MMCM on all 7-series/Ultrascale with self.reset signal 2019-11-20 19:24:40 +01:00
enjoy-digital e8e70b164a
Merge pull request #309 from antmicro/mmcm-fix
soc/cores/clock: add lock reg and assign reset
2019-11-20 19:20:15 +01:00
Pawel Czarnecki fd14b76594 soc/cores/clock: add lock reg and assign reset
It was necessary to add drp_locked CSR for reading LOCK signal from
MMCM. Additionally, input signal RESET from MMCM was not driven by
any signal to do a proper reset of MMCM module thus it was impossible
to perform entirely correct dynamic clock reconfiguration.
2019-11-20 16:22:49 +01:00
Florent Kermarrec 04017519c8 soc/interconnect/axi: add Wishbone2AXILite 2019-11-20 12:32:22 +01:00
Florent Kermarrec d905521185 build/tools/get_migen/litex_git_revision: avoid git fatal error message is not installed as a git repository 2019-11-19 09:11:11 +01:00
enjoy-digital 02bfda5e38
Merge pull request #308 from gsomlo/gls-sdram-init
soc_sdram, bios/sdram: support sdram init for csr_data_width <= 32
2019-11-18 18:24:35 +01:00
Gabriel Somlo 3ef13fd27a soc_sdram, bios/sdram: support sdram init for csr_data_width <= 32
Enable SDRAM to be initialized when csr_data_width > 8 bits.
Currently, csr_data_width up to 32 bits is supported.

Read leveling tested with csr_data_width [8, 16, 32] on the
ecp5-versa5g and trellisboard (using yosys/trellis/nextpnr),
and on the nexys4ddr (using Vivado).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-11-18 09:00:19 -05:00
Florent Kermarrec 1efb18f1ea soc/interconnect/packet/Depacketizer: another simplifcation pass 2019-11-18 09:06:56 +01:00
Florent Kermarrec af52203c00 soc/interconnect/packet/Depacketizer: cleanup "ALIGNED-DATA-COPY" state 2019-11-17 11:57:14 +01:00
Florent Kermarrec 8272a00d6e soc/interconnect/packet/Depacketizer: replace no_payload with sink_d.last 2019-11-17 11:50:09 +01:00
Florent Kermarrec 6059712794 test/test_packet: add randomness on ready output, fix corner-cases on Packetizer/Depacketizer 2019-11-16 14:39:18 +01:00
Florent Kermarrec 9642893371 test/test_packet: add randomness on valid input, fix corner-cases on Packetizer 2019-11-16 08:49:04 +01:00
enjoy-digital 888fd55bd8
Merge pull request #307 from sergachev/master
change >512 B CSR memory exception to a warning
2019-11-15 18:17:35 +01:00
Florent Kermarrec 2f2cfc9951 soc/interconnect/packet: fix synthesis (synthesis tools can do all sort of optimizations, but we still need to provide valid verilog :)) 2019-11-15 16:19:05 +01:00
Ilia Sergachev 444ae951e9 change >512 B CSR memory exception to a warning 2019-11-15 15:34:12 +01:00
Florent Kermarrec 31661e9e2d soc/interconnect/packet: connect error/last_be only present on both sink and source 2019-11-15 14:57:31 +01:00
Florent Kermarrec 2946581e50 soc/interconnect/packet: simplify/refactor Packetizer/Depacketizer to keep it simple
To avoid complex FSMs, let the synthesis tool do the simplifications when the FSM states are not reachable.
2019-11-15 14:39:55 +01:00
Florent Kermarrec 86662b54d0 soc/interconnect/packet: update copyright 2019-11-15 11:25:38 +01:00
Vamsi K Vytla 5c19b133ac soc/interconnect/packet: add > 8-bit support to Packetizer/Depacketizer
With high speed link (10gbps XGMII ethernet for example), stream data_width is generally
> 8-bit which make header/data un-aligned on bytes boundaries. The change allows the
Packetizer/Depacketizer to work on stream with a data_width > 8-bit.
2019-11-15 11:24:17 +01:00
Florent Kermarrec 5f151152ca build/sim: cleanup run_as_root 2019-11-15 10:57:31 +01:00
Vamsi K Vytla 446ae57b75 build/sim/modules: add XGMII 10Gbps ethernet module
Used to simulate SoCs with XGMII 10Gbps ethernet and to do LiteEth verification
2019-11-15 10:51:55 +01:00
Florent Kermarrec 56fbd2f250 sim/ethernet: remove trailing whitespaces 2019-11-15 10:39:49 +01:00
Florent Kermarrec eb3888f68e tools/litex_sim: cleanup/update (no functional change) 2019-11-14 11:19:23 +01:00
Florent Kermarrec 4798d6b750 tools/litex_term: remove automatic reboot when flashing and clear mem_regions to avoid re-flashing on next reboot(s) 2019-11-11 18:38:10 +01:00
Florent Kermarrec a17e307acf bios/flash: minor cleanup on serialboot flashing, add flash address support 2019-11-09 00:05:36 +01:00
enjoy-digital 2d6100bdbe
Merge pull request #305 from FrankBuss/master
adding support to flash an FBI image
2019-11-08 23:51:49 +01:00
Florent Kermarrec 05e8abfee3 soc_core: add integrated-rom-file parameter to allow initializing rom from command line 2019-11-08 23:32:10 +01:00
Florent Kermarrec 0a030fe17d cores/code_8b10b/Decoder: add basic invalid symbols detection
Check that we have 4,5 or 6 ones in the symbol. This does not report all
invalid symbols but still allow detecting issues with the link.
2019-11-08 19:43:01 +01:00
fb@frank-buss.de 9857d9d9d2 adding support to flash an FBI image 2019-11-08 17:16:28 +01:00
Florent Kermarrec c96f31a9ad software/bios: rename ef command to fe (for consistency) 2019-11-08 13:14:21 +01:00
Florent Kermarrec 4a12a92d62 software/libbase/spiflash: rename CHIP_ERASE_CMD to CE_CMD (for consistency) 2019-11-08 13:13:54 +01:00
enjoy-digital 7fb9cfeb64
Merge pull request #302 from FrankBuss/master
erase flash command added
2019-11-08 13:04:33 +01:00
Florent Kermarrec db4739df81 soc_core: remove add_cpu method (when no real CPU but only wishbone masters, self.cpu is declared as CPUNone) 2019-11-08 12:55:29 +01:00
fb@frank-buss.de 468df3c857 erase flash command added 2019-11-07 19:19:54 +01:00
Florent Kermarrec f1714405c3 integration/export: do not include soc.h in csr.h when with_access_functions=False
Idealy we should have another parameter for that.
2019-11-07 09:02:31 +01:00
Florent Kermarrec b52dcde9ba soc_sdram/kcu105: add optional main_ram_size_limit and use it on KCU105 to limit to 1GB instead of 2GB.
CSR map will need to be updated to support the 2GB.
2019-11-07 09:00:54 +01:00
Florent Kermarrec 9053d0803a soc_sdram: remove use_full_memory_we parameter (always used as True) 2019-11-07 08:56:52 +01:00
Florent Kermarrec 1b94699d12 soc_sdram: update copyrights 2019-11-07 08:44:34 +01:00
Gabriel Somlo 28708f4208 cpu/rocket: parameterize axi interface data width
Rocket variants can be configured with axi port data widths that
are multiples of the native word size (64 bits in our case). In
the future, we will add variants with mem_axi data width > 64 bit,
to match the native data width of the LiteDRAM controller on
various development boards (e.g., 128 bits on the ecp5versa, and
256 bits on the trellisboard).

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-11-01 08:55:27 -04:00
Gabriel Somlo 014db66444 soc_sdram: remove upper limit on usable main RAM
Revert commit #68a503174.
2019-11-01 08:55:15 -04:00
Gabriel Somlo ec831f5b63 cpu/rocket, soc_sdram: Connect mem_axi to LiteDRAM, bypass WB bus
Connect Rocket's dedicated port for cached RAM accesses (mem_axi)
directly to the LiteDRAM data port, bypassing the shared LiteX
(Wishbone) bus.

When both Rocket's mem_axi and LiteDRAM's port have the same data
width, use a native point-to-point AXI connection.

Otherwise, convert both ends to Wishbone, and use the Wishbone
data width converter to bridge the gap.
FIXME: In the future, this part should be replaced with a native
AXI data width converter!

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-11-01 08:52:39 -04:00
Florent Kermarrec 9c3c43c94a interconnect/csr_bus/SRAM: add mem_size check
Memory size is limited to 512 bytes:
- CSR region size is 0x800 (4096)
- default csr_data_width is 8
maximum size = 4096/8 = 512 bytes.
2019-11-01 11:33:50 +01:00
Florent Kermarrec edb1731ef9 soc_core/soc_core_args: specify default cpu (vexriscv) 2019-11-01 11:30:50 +01:00
Florent Kermarrec cc607f022a lattice/diamond/tcl: always use / separators, even on windows 2019-11-01 10:11:12 +01:00
Florent Kermarrec 59acf0ea1c cpu/minerva: elaborate minerva verilog to build directory 2019-11-01 09:59:13 +01:00
Florent Kermarrec a762d29b19 soc/integration/builder: pass output_dir to platform, make sure gateware/software directory are created before finalizing 2019-11-01 09:59:06 +01:00
Florent Kermarrec 855d0e925d cpu/minerva: generate minerva.v near core.py not in submodule 2019-10-31 21:16:27 +01:00
Florent Kermarrec 85d6607257 cpu/minverva: give more explicit error message when not able to elaborate cpu 2019-10-31 08:52:04 +01:00
Tim 'mithro' Ansell 4408dad9d2 Improve the error message on memory region conflict.
Before;
```
ValueError: Memory region conflict between rom and main_ram
```

After;
```
ValueError: Memory region conflict between rom (<SoCMemRegion 0x10000000 0x10000 cached>) and main_ram (<SoCMemRegion 0x0 0x20000000 cached>)
```

Fixes #296.
2019-10-30 19:32:20 -07:00
Tim 'mithro' Ansell 607e1cc4f6 Fix file names for the mor1kx processor.
Fixes #292.
2019-10-30 13:50:01 -07:00
Florent Kermarrec a54b80b9b4 targets: use type="io" instead of io_region=True 2019-10-30 16:42:31 +01:00
Florent Kermarrec a0c0a6fd05 integration/SoCMemRegion: use type instead of io_region/linker_region and export type to csv/json
Supported types: "cached", "io", "cached+linker", "io+linker", default="cached"
2019-10-30 16:42:26 +01:00
Florent Kermarrec 9fcf297387 soc_core: add check_regions_overlap method, add linker_region support (overlap is not checked on linker_regions) 2019-10-28 18:34:03 +01:00
Florent Kermarrec 4014fbffe1 soc_core/add_memory_region: fix memory overlap detection 2019-10-28 17:07:37 +01:00
Florent Kermarrec ab8af28213 cpu/minerva: elaborate from nmigen sources during build, enable hardware multiplier 2019-10-28 10:23:08 +01:00
Gabriel Somlo 49372852da build/lattice/trellis: optionally allow failure if p&r timing not met
When timing requirements are strict, allow the build process to fail upon
failure to meet timing. This facilitates running the build process from a
loop, repeatedly, until a "lucky" p&r solution is found, e.g.:

  while true; do
    litex/boards/targets/versa_ecp5.py --gateware-toolchain trellis \
      --sys-clk-freq=60e06 --cpu-type rocket --cpu-variant linux \
      --with-ethernet --yosys-nowidelut \
      --nextpnr-timingstrict
    if [ "$?" == "0" ]; then
      echo "Success" | mail -s "Build Succeeded" your@email.here
      break
    fi
  done

This augments commit #683e0668, which unconditionally forced p&r to
succeed, regardless of whether timing was met, via '--timing-allow-fail'.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2019-10-24 13:56:20 -04:00
enjoy-digital b6d35c92ae
Merge pull request #283 from kbeckmann/kbeckmann/bios_increment_address
bios: Increment address when writing to flash
2019-10-20 15:30:22 +02:00
Konrad Beckmann ef78ae951f bios: Increment address when writing to flash 2019-10-19 22:58:24 +02:00
Florent Kermarrec 683e066812 build/lattice/trellis: use --timing-allow-fail to allow generating bistream when timings are not met
This is the default behaviour of the others tools and allow testing designs on hardware with small violations.
2019-10-18 14:12:01 +02:00
Florent Kermarrec 4cf346a1d4 soc/cores/icap/ICAPBitstream: always keep fifo.source.ready to 1 2019-10-18 10:27:37 +02:00
Jan Kowalewski 8b5da9c623 cores/icap/ICAPBitstream: add source ready signal. 2019-10-18 09:33:31 +02:00
Florent Kermarrec 626533ce9d soc/integration/__init__: remove imports (not used and causing issues 2019-10-17 12:44:37 +02:00
Florent Kermarrec 675b455259 build: always use platform.add_source and avoid manipulate platform.sources directly 2019-10-17 12:17:36 +02:00
Florent Kermarrec 43f5d1ef13 build/generic_platform: replace set with list for sources/verilog_include_paths
Python does not have native OrderedSet and we need to be able to preserve the order of the sources
for some backends (Verilator for instance), so use list instead of set.
2019-10-17 09:52:49 +02:00
Florent Kermarrec 97a77b950c cores/icap/ICAPBitstream: simplify, add icap_clk_div parameter, describe how to use it. 2019-10-16 15:00:58 +02:00
Florent Kermarrec 98c224be15 build/generic_platform: keep language to None if None after tools.language_by_filename 2019-10-15 12:14:37 +02:00
Florent Kermarrec 14dae8bd73 soc_core: fix default --uart_name 2019-10-14 22:15:02 +02:00
Florent Kermarrec ba26441889 integration/soc_core: expose more SoC parameters 2019-10-14 09:12:25 +02:00
Konrad Beckmann 0e467168fd picorv32: Fix minimal variant params
The param p_ENABLE_COUNTERS was misspelled.
2019-10-13 12:56:55 +02:00
Florent Kermarrec ef504f62af soc_core: fix soc_core_argdict 2019-10-12 23:05:53 +02:00
Florent Kermarrec cd8213b988 cpu/lm32: add missing buses 2019-10-12 19:20:50 +02:00
Florent Kermarrec 5a0358754d soc_core/soc_core_argdict: use inspect to get all parameters and simplify 2019-10-12 19:18:57 +02:00
Florent Kermarrec 96c369f3e4 integration: simplify cpu buses auto-conversion (always use Converter, thanks gsomlo) 2019-10-11 21:55:26 +02:00
Florent Kermarrec 29e51f5e97 interconnect/wishbone: fix Converter case when buses are identical 2019-10-11 21:49:11 +02:00
Florent Kermarrec ae9c25b74f platforms/versa_ecp5: add serdes refclk/sma 2019-10-11 19:51:38 +02:00