litex.git
4 years agocores/clock/xadc: ease DRP timings
bunnie [Sun, 19 Jan 2020 19:55:10 +0000 (20:55 +0100)]
cores/clock/xadc: ease DRP timings

Hard IP blocks are fixed in location, so long/deep combinational paths routing to multiple hard IP blocks can lead to timing closure problems.

XADC and MMCM DRPs currently have their DEN pins triggered by the ".re" output of a CSR. This is asynchronously derived from a fairly complicated set of logic that involves a logic path that goes all the way back through the cache and arbitration mechanisms of the wishbone bus. On more complex designs, this is leading to a failure of timing closure for these paths, because the hard IP blocks can be located in disparate portions of the chip which "pulls" the logic cluster in opposite directions in an attempt to absorb the routing delays to these IP blocks, leading to non-optimal placement for everything else and thus timing closure problems.

This pull request proposes that we add a pipeline delay on these critical paths. This delays the commit of the data to the DRP by one cycle, but greatly relieves timing because the pipeline register can be placed close to the cluster of logic that computes addresses, caching, and arbitration, allowing for the routing slack to the hard IP blocks to be absorbed by the path between the pipe register and the hard IP block.

In general, this shouldn't be a problem because the algorithm to program the DRP is to hit the write or read CSR, and then poll the drdy bit until it is asserted (so the process is already pretty slow). The MMCM in particular should have almost no impact, because MMCM updates are infrequent and the subsequent lock time of the MMCM is pretty long. The XADC is potentially more problematic because it can produce data at up to 1MSPS; but if sysclk is around 100MHz, adding 10ns to the read latency is relatively small compared to the theoretical maximum data rate of one every 1,000ns.

Note that the xadc patch requires introducing a bit of logic into the non-DRP path. This is because without explicitly putting an "if" statement around the logic, you fall back to the non-blocking semantics of the verilog operator, which ultimately leads to a pretty hefty combinational path. By having a default "if" that should get optimized out when DRP is not enabled, when the DRP path /is/ enabled the synthesizer knows it can safely push the async signal into a simple mux as opposed to worrying about enforcing the non-blocking operator semantics to get the desired result.

4 years agotest/test_targets: limit max_sdram_size to 1GB
Florent Kermarrec [Fri, 17 Jan 2020 12:24:45 +0000 (13:24 +0100)]
test/test_targets: limit max_sdram_size to 1GB

4 years agotargets/nexys4ddr: fix typo
Florent Kermarrec [Fri, 17 Jan 2020 12:17:08 +0000 (13:17 +0100)]
targets/nexys4ddr: fix typo

4 years agoSoCSDRAM: set default max_sdram_size to 1GB (maximum we can map with current mem_map)
Florent Kermarrec [Fri, 17 Jan 2020 11:45:23 +0000 (12:45 +0100)]
SoCSDRAM: set default max_sdram_size to 1GB (maximum we can map with current mem_map)

4 years agotargets/kcu105: remove main_ram_size_limit
Florent Kermarrec [Fri, 17 Jan 2020 11:27:21 +0000 (12:27 +0100)]
targets/kcu105: remove main_ram_size_limit

4 years agoSoCSDRAM: rename main_ram_size_limit to max_sdram_size and make it a parameter of...
Florent Kermarrec [Fri, 17 Jan 2020 11:16:08 +0000 (12:16 +0100)]
SoCSDRAM: rename main_ram_size_limit to max_sdram_size and make it a parameter of SoCSDRAM, expose SoCSDRAM parameters to user

4 years agobuild/lattice: add add_false_path_constraint method for API compatibility but false...
Florent Kermarrec [Fri, 17 Jan 2020 07:53:24 +0000 (08:53 +0100)]
build/lattice: add add_false_path_constraint method for API compatibility but false paths are not yet used/translated to .lpf file

4 years agosoc/cores/uart: set rx_fifo_rx_we to True on UARTCrossover
Florent Kermarrec [Fri, 17 Jan 2020 05:32:00 +0000 (06:32 +0100)]
soc/cores/uart: set rx_fifo_rx_we to True on UARTCrossover

4 years agosoc/cores/uart: add rx_fifo_rx_we parameter to pulse rx_fifo.source.ready on rxtx...
Florent Kermarrec [Thu, 16 Jan 2020 18:45:41 +0000 (19:45 +0100)]
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).

4 years agocpu/vexriscv: use 32-bit signal for externalResetVector
Florent Kermarrec [Thu, 16 Jan 2020 15:20:25 +0000 (16:20 +0100)]
cpu/vexriscv: use 32-bit signal for externalResetVector

4 years agotargets/arty/genesys2: fix EthernetSoC/EtherboneSoC selection
Florent Kermarrec [Thu, 16 Jan 2020 12:17:33 +0000 (13:17 +0100)]
targets/arty/genesys2: fix EthernetSoC/EtherboneSoC selection

4 years agotargets/genesys2: add EtherboneSoC
Florent Kermarrec [Thu, 16 Jan 2020 11:32:59 +0000 (12:32 +0100)]
targets/genesys2: add EtherboneSoC

4 years agoplatforms/de0nano: specify gpio for serial
Florent Kermarrec [Thu, 16 Jan 2020 11:32:25 +0000 (12:32 +0100)]
platforms/de0nano: specify gpio for serial

4 years agotargets: cleanup EthernetSoC
Florent Kermarrec [Thu, 16 Jan 2020 09:14:42 +0000 (10:14 +0100)]
targets: cleanup EthernetSoC

4 years agosoc/interconnect/packet/Depacketizer: use both sink.valid and sink.ready to update...
Florent Kermarrec [Thu, 16 Jan 2020 08:46:54 +0000 (09:46 +0100)]
soc/interconnect/packet/Depacketizer: use both sink.valid and sink.ready to update sink_d, fix Etherbone regression on Arty.

4 years agotargets/arty: add EtherboneSoC
Florent Kermarrec [Thu, 16 Jan 2020 08:11:44 +0000 (09:11 +0100)]
targets/arty: add EtherboneSoC

4 years agotargets/kcu105: update
Florent Kermarrec [Wed, 15 Jan 2020 12:17:59 +0000 (13:17 +0100)]
targets/kcu105: update

4 years agotest/test_targets: update
Florent Kermarrec [Wed, 15 Jan 2020 12:09:03 +0000 (13:09 +0100)]
test/test_targets: update

4 years agoSoCCore: set default integrated_rom/ram_size to 0. For targets, defaults values are...
Florent Kermarrec [Tue, 14 Jan 2020 08:23:30 +0000 (09:23 +0100)]
SoCCore: set default integrated_rom/ram_size to 0. For targets, defaults values are provided by soc_core_args.

4 years agoSoCCore: use hex for integrated_rom/sram_size
Florent Kermarrec [Mon, 13 Jan 2020 19:01:45 +0000 (20:01 +0100)]
SoCCore: use hex for integrated_rom/sram_size

4 years agoMerge pull request #339 from gsomlo/gls-csr-cleanup
enjoy-digital [Mon, 13 Jan 2020 18:57:59 +0000 (19:57 +0100)]
Merge pull request #339 from gsomlo/gls-csr-cleanup

CSR Improvements and Cleanup

4 years agotools/litex_sim: use default integrated_rom_size
Florent Kermarrec [Mon, 13 Jan 2020 16:39:23 +0000 (17:39 +0100)]
tools/litex_sim: use default integrated_rom_size

4 years agocores/uart/UARTInterface: remove connect method
Florent Kermarrec [Mon, 13 Jan 2020 15:58:00 +0000 (16:58 +0100)]
cores/uart/UARTInterface: remove connect method

4 years agosoc_core: fix uart stub
Florent Kermarrec [Mon, 13 Jan 2020 15:56:31 +0000 (16:56 +0100)]
soc_core: fix uart stub

4 years agobios/sdram: switch to updated CSR accessors, and misc. cleanup
Gabriel Somlo [Sun, 12 Jan 2020 00:38:15 +0000 (19:38 -0500)]
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>
4 years agosoftware, integration/export: rename and reimplement CSR accessors
Gabriel Somlo [Wed, 18 Dec 2019 20:53:21 +0000 (15:53 -0500)]
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>
4 years agocpu/vexriscv: revert mem_map_linux/main_ram
Florent Kermarrec [Mon, 13 Jan 2020 15:02:32 +0000 (16:02 +0100)]
cpu/vexriscv: revert mem_map_linux/main_ram

4 years agoSoCCore: set integrated rom/sram size default values in soc_core_args and use it...
Florent Kermarrec [Mon, 13 Jan 2020 13:59:17 +0000 (14:59 +0100)]
SoCCore: set integrated rom/sram size default values in soc_core_args and use it in targets

4 years agocpu/vexriscv/mem_map_linux: update main_ram to 0x40000000
Florent Kermarrec [Mon, 13 Jan 2020 13:40:26 +0000 (14:40 +0100)]
cpu/vexriscv/mem_map_linux: update main_ram to 0x40000000

4 years agotargets/genesys2: update self.register_sdram
Florent Kermarrec [Mon, 13 Jan 2020 13:39:45 +0000 (14:39 +0100)]
targets/genesys2: update self.register_sdram

4 years agosoc_sdram: add l2_data_width parameter to set minimal l2_data_width to improve DRAM...
Florent Kermarrec [Mon, 13 Jan 2020 12:00:17 +0000 (13:00 +0100)]
soc_sdram: add l2_data_width parameter to set minimal l2_data_width to improve DRAM accesses efficiency.

4 years agocores/uart: add UARTCrossover
Florent Kermarrec [Mon, 13 Jan 2020 09:14:38 +0000 (10:14 +0100)]
cores/uart: add UARTCrossover

4 years agocores/uart/UART: add stream interface (phy=None), add connect method and use this...
Florent Kermarrec [Mon, 13 Jan 2020 08:20:40 +0000 (09:20 +0100)]
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)

4 years agogen/fhdl/verilog: fix signed init values
Florent Kermarrec [Sun, 12 Jan 2020 21:06:35 +0000 (22:06 +0100)]
gen/fhdl/verilog: fix signed init values

4 years agoMerge pull request #338 from DurandA/master
enjoy-digital [Sun, 12 Jan 2020 20:18:23 +0000 (21:18 +0100)]
Merge pull request #338 from DurandA/master

Add optional 'ignore-loops' flag to nextpnr

4 years agocores/uart: rename BridgedUART to UARTEmulator and rework/simplify it. Also integrate...
Florent Kermarrec [Sun, 12 Jan 2020 20:11:44 +0000 (21:11 +0100)]
cores/uart: rename BridgedUART to UARTEmulator and rework/simplify it. Also integrated it in SoCCore with uart_name="emulator"

4 years agoMerge pull request #340 from xobs/bridged-uart
enjoy-digital [Sun, 12 Jan 2020 19:40:27 +0000 (20:40 +0100)]
Merge pull request #340 from xobs/bridged-uart

uart: add BridgedUart

4 years agouart: add BridgedUart
Sean Cross [Sun, 12 Jan 2020 09:52:42 +0000 (19:52 +1000)]
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>
4 years agoAdd optional 'ignore-loops' flag to nextpnr
Arnaud Durand [Fri, 10 Jan 2020 15:06:08 +0000 (16:06 +0100)]
Add optional 'ignore-loops' flag to nextpnr

4 years agobios/sdram: add memspeed
Florent Kermarrec [Fri, 10 Jan 2020 13:25:46 +0000 (14:25 +0100)]
bios/sdram: add memspeed

4 years agowishbone/Cache: avoid REFILL_WRTAG state to improve speed.
Florent Kermarrec [Fri, 10 Jan 2020 11:52:14 +0000 (12:52 +0100)]
wishbone/Cache: avoid REFILL_WRTAG state to improve speed.

4 years agosoc/cores/cpu: add riscv64-linux toolchain support for risc-v cpus.
Florent Kermarrec [Fri, 10 Jan 2020 07:49:23 +0000 (08:49 +0100)]
soc/cores/cpu: add riscv64-linux toolchain support for risc-v cpus.

Toolchain can be downloaded from https://toolchains.bootlin.com/

4 years agotargets: sync with litex-boards
Florent Kermarrec [Thu, 9 Jan 2020 20:12:00 +0000 (21:12 +0100)]
targets: sync with litex-boards

4 years agobuild/altera/quartus: allow multiple call of add_period_constraint if constraint...
Florent Kermarrec [Thu, 9 Jan 2020 18:45:51 +0000 (19:45 +0100)]
build/altera/quartus: allow multiple call of add_period_constraint if constraint is similar.

Similar to the changes already applied to Xilinx backend.

4 years agoMerge pull request #337 from gregdavill/spi-flash
enjoy-digital [Thu, 9 Jan 2020 12:24:17 +0000 (13:24 +0100)]
Merge pull request #337 from gregdavill/spi-flash

soc/cores/spi_flash: Don't tristate DQ2/DQ3 when bitbanging

4 years agosoc/cores/spi_flash: Don't tristate DQ2/DQ3 when bitbanging
Greg Davill [Thu, 9 Jan 2020 11:23:00 +0000 (21:53 +1030)]
soc/cores/spi_flash: Don't tristate DQ2/DQ3 when bitbanging

4 years agoplatforms/minispartan6: rename sd to sdcard and regroup data lines
Florent Kermarrec [Thu, 9 Jan 2020 10:03:17 +0000 (11:03 +0100)]
platforms/minispartan6: rename sd to sdcard and regroup data lines

4 years agoplatforms/nexys4ddr: add sdcard pins
Florent Kermarrec [Thu, 9 Jan 2020 10:00:54 +0000 (11:00 +0100)]
platforms/nexys4ddr: add sdcard pins

4 years agobuild/lattice/trellis: use a single fonction to parse device
Florent Kermarrec [Wed, 8 Jan 2020 18:38:27 +0000 (19:38 +0100)]
build/lattice/trellis: use a single fonction to parse device

4 years agoMerge pull request #336 from kbeckmann/trellis-speed
enjoy-digital [Wed, 8 Jan 2020 18:17:04 +0000 (19:17 +0100)]
Merge pull request #336 from kbeckmann/trellis-speed

trellis: Pass speed argument to nextpnr

4 years agotrellis: Pass speed grade argument to nextpnr
Konrad Beckmann [Tue, 7 Jan 2020 22:15:13 +0000 (23:15 +0100)]
trellis: Pass speed grade argument to nextpnr

4 years agoMerge pull request #331 from betrusted-io/xadc_mods
enjoy-digital [Mon, 6 Jan 2020 17:09:12 +0000 (18:09 +0100)]
Merge pull request #331 from betrusted-io/xadc_mods

WIP: add support for DRP on XADC

4 years agosoc/cores/xadc: define analog_layout and simplify analog_pads connections
Florent Kermarrec [Mon, 6 Jan 2020 15:28:48 +0000 (16:28 +0100)]
soc/cores/xadc: define analog_layout and simplify analog_pads connections

4 years agobring back analog_pads specifier, remove reset conditions on VP
bunnie [Mon, 6 Jan 2020 13:47:58 +0000 (21:47 +0800)]
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?

4 years agocpu/minerva: fix variant syntax warning
Florent Kermarrec [Sun, 5 Jan 2020 20:04:13 +0000 (21:04 +0100)]
cpu/minerva: fix variant syntax warning

4 years agosoc/core/xadc: cleanup, simplify and add expose_drp method - keep CSR ordering with...
Florent Kermarrec [Sat, 4 Jan 2020 22:59:04 +0000 (23:59 +0100)]
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.

4 years agoMerge pull request #332 from gsomlo/gls-csr-mem-sel
enjoy-digital [Sat, 4 Jan 2020 18:19:38 +0000 (19:19 +0100)]
Merge pull request #332 from gsomlo/gls-csr-mem-sel

interconnect/csr_bus/SRAM: allow 64-bit alignment (on 64-bit CPUs)

4 years agointerconnect/csr_bus/SRAM: allow 64-bit alignment (on 64-bit CPUs)
Gabriel Somlo [Fri, 3 Jan 2020 21:27:44 +0000 (16:27 -0500)]
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>
4 years agofix a couple bugs in the DRP readout path
bunnie [Fri, 3 Jan 2020 19:03:59 +0000 (03:03 +0800)]
fix a couple bugs in the DRP readout path

I'm now getting data out via DRP. Still some TODOs, but
progress.

4 years agoadd support for DRP on XADC
bunnie [Fri, 3 Jan 2020 16:25:09 +0000 (00:25 +0800)]
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.

4 years agocpu/microwatt: reorder sources, add comments
Florent Kermarrec [Fri, 3 Jan 2020 14:29:10 +0000 (15:29 +0100)]
cpu/microwatt: reorder sources, add comments

4 years agobuild/lattice/icestorm: increase similarities with trellis.
Florent Kermarrec [Thu, 2 Jan 2020 09:23:05 +0000 (10:23 +0100)]
build/lattice/icestorm: increase similarities with trellis.

4 years agosoc/integration/soc_core/SoCController: specify initial reset value of scratch regist...
Florent Kermarrec [Thu, 2 Jan 2020 08:41:47 +0000 (09:41 +0100)]
soc/integration/soc_core/SoCController: specify initial reset value of scratch register in description

4 years agosoc/integration/soc_core/SoCController: rephrase CSR descriptions a bit
Florent Kermarrec [Thu, 2 Jan 2020 08:38:23 +0000 (09:38 +0100)]
soc/integration/soc_core/SoCController: rephrase CSR descriptions a bit

4 years agoMerge pull request #330 from xobs/document-ctrl-timer0
enjoy-digital [Thu, 2 Jan 2020 08:26:35 +0000 (09:26 +0100)]
Merge pull request #330 from xobs/document-ctrl-timer0

Document CTRL and fix TIMER0 Documentation

4 years agocores: timer: clean up wording for timer documentation
Sean Cross [Thu, 2 Jan 2020 08:24:12 +0000 (16:24 +0800)]
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>
4 years agosoc_core: ctrl: document registers
Sean Cross [Thu, 2 Jan 2020 07:37:45 +0000 (15:37 +0800)]
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>
4 years agocores: timer: fix documentation formatting
Sean Cross [Thu, 2 Jan 2020 07:36:35 +0000 (15:36 +0800)]
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>
4 years agosoc/cores/clock: also allow margin=0 on iCE40PLL and ECP5PLL
Florent Kermarrec [Wed, 1 Jan 2020 12:24:06 +0000 (13:24 +0100)]
soc/cores/clock: also allow margin=0 on iCE40PLL and ECP5PLL

4 years agoMerge pull request #328 from betrusted-io/precise_clocks
enjoy-digital [Wed, 1 Jan 2020 12:20:15 +0000 (13:20 +0100)]
Merge pull request #328 from betrusted-io/precise_clocks

add the possibility for a "precise" clock solution

4 years agoadd the possibility for a "precise" clock solution
bunnie [Wed, 1 Jan 2020 10:49:00 +0000 (18:49 +0800)]
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.

4 years agobuild/microsemi/libero_soc: update add_period_constraint behavior when clock is alrea...
Florent Kermarrec [Tue, 31 Dec 2019 09:33:12 +0000 (10:33 +0100)]
build/microsemi/libero_soc: update add_period_constraint behavior when clock is already constrainted.

4 years agobuild/xilinx/vivado: update add_period_constraint behavior when clock is already...
Florent Kermarrec [Tue, 31 Dec 2019 09:32:09 +0000 (10:32 +0100)]
build/xilinx/vivado: update add_period_constraint behavior when clock is already constrainted.

4 years agobuild/lattice/icestorm/add_period_constraint: improve
Florent Kermarrec [Tue, 31 Dec 2019 09:25:51 +0000 (10:25 +0100)]
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.

4 years agosoc/integration/builder: avoid try/except on LiteDRAM import, just check if SoC has...
Florent Kermarrec [Tue, 31 Dec 2019 08:58:26 +0000 (09:58 +0100)]
soc/integration/builder: avoid try/except on LiteDRAM import, just check if SoC has an sdram and do the import if so

4 years agoMerge pull request #327 from zakgi/master
enjoy-digital [Tue, 31 Dec 2019 08:49:53 +0000 (09:49 +0100)]
Merge pull request #327 from zakgi/master

moving RAM offsets outside of CSR_ETHMAC define

4 years agoAllow specifying the same clock constraint multiple times.
Tim 'mithro' Ansell [Mon, 30 Dec 2019 18:25:14 +0000 (19:25 +0100)]
Allow specifying the same clock constraint multiple times.

(As long as the clock values actually match.)

4 years agoAllow LiteX builder to be used without LiteDRAM.
Tim 'mithro' Ansell [Mon, 30 Dec 2019 18:24:26 +0000 (19:24 +0100)]
Allow LiteX builder to be used without LiteDRAM.

4 years agoImprove the invalid CPU type error message.
Tim 'mithro' Ansell [Mon, 30 Dec 2019 15:10:57 +0000 (16:10 +0100)]
Improve the invalid CPU type error message.

4 years agobuild/xilinx/programmer: fix vivado_cmd when settings are sourced manually.
Florent Kermarrec [Mon, 30 Dec 2019 09:07:08 +0000 (10:07 +0100)]
build/xilinx/programmer: fix vivado_cmd when settings are sourced manually.

4 years agomoving RAM offsets outside of CSR_ETHMAC define
Giammarco Zacheo [Mon, 30 Dec 2019 06:56:42 +0000 (22:56 -0800)]
moving RAM offsets outside of CSR_ETHMAC define

4 years agoMerge pull request #321 from gsomlo/gls-rocket-aximem-wide
enjoy-digital [Sat, 21 Dec 2019 20:31:04 +0000 (21:31 +0100)]
Merge pull request #321 from gsomlo/gls-rocket-aximem-wide

cpu/rocket: variants with double (128b) and quad (256b) wide mem_axi

4 years agoMerge pull request #319 from DurandA/feature-integer-attributes
enjoy-digital [Sat, 21 Dec 2019 20:30:09 +0000 (21:30 +0100)]
Merge pull request #319 from DurandA/feature-integer-attributes

Add integer attributes

4 years agocpu/rocket: variants with double (128b) and quad (256b) wide mem_axi
Gabriel Somlo [Fri, 29 Nov 2019 23:42:54 +0000 (18:42 -0500)]
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>
4 years agoMerge pull request #320 from gsomlo/gls-touch-up
enjoy-digital [Sat, 21 Dec 2019 18:40:21 +0000 (19:40 +0100)]
Merge pull request #320 from gsomlo/gls-touch-up

Misc. Rocket and CSR cleanup

4 years agosoc_core: csr_alignment assertions
Gabriel Somlo [Wed, 18 Dec 2019 16:24:11 +0000 (11:24 -0500)]
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>
4 years agocpu/rocket: access PLIC registers via pointer dereference
Gabriel Somlo [Sat, 21 Dec 2019 17:59:19 +0000 (12:59 -0500)]
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>
4 years agocpu/microwatt: add initial software support
Florent Kermarrec [Fri, 20 Dec 2019 22:32:21 +0000 (23:32 +0100)]
cpu/microwatt: add initial software support

4 years agoAdd integer attributes
Arnaud Durand [Thu, 19 Dec 2019 08:03:12 +0000 (09:03 +0100)]
Add integer attributes

4 years agoRevert "gen/fhdl/verilog: allow single element verilog inline attribute"
Arnaud Durand [Thu, 19 Dec 2019 07:53:44 +0000 (08:53 +0100)]
Revert "gen/fhdl/verilog: allow single element verilog inline attribute"

This reverts commit b845755995a8517d8e0ffa86156fb5577201f7d4.

4 years agocpu/microwatt: add submodule
Florent Kermarrec [Wed, 18 Dec 2019 18:02:30 +0000 (19:02 +0100)]
cpu/microwatt: add submodule

4 years agocpu/microwatt: set csr to 0xc0000000 (IO region)
Florent Kermarrec [Wed, 18 Dec 2019 07:59:35 +0000 (08:59 +0100)]
cpu/microwatt: set csr to 0xc0000000 (IO region)

4 years agocpu/microwatt: fix add_source/add_sources
Florent Kermarrec [Wed, 18 Dec 2019 07:56:36 +0000 (08:56 +0100)]
cpu/microwatt: fix add_source/add_sources

4 years agosoc/cores/pwm: remove debug print(n)
Florent Kermarrec [Wed, 18 Dec 2019 07:46:38 +0000 (08:46 +0100)]
soc/cores/pwm: remove debug print(n)

4 years agoplatforms/netv2: add xc7a100t support
Florent Kermarrec [Tue, 17 Dec 2019 08:47:31 +0000 (09:47 +0100)]
platforms/netv2: add xc7a100t support

4 years agoplatforms/minispartan6: add assert on available devices
Florent Kermarrec [Tue, 17 Dec 2019 08:47:12 +0000 (09:47 +0100)]
platforms/minispartan6: add assert on available devices

4 years agocpu/microwatt: simplify add_sources
Florent Kermarrec [Tue, 17 Dec 2019 08:41:46 +0000 (09:41 +0100)]
cpu/microwatt: simplify add_sources

4 years agocpu/microwatt: add io_regions and gcc_flags
Florent Kermarrec [Tue, 17 Dec 2019 08:33:46 +0000 (09:33 +0100)]
cpu/microwatt: add io_regions and gcc_flags

4 years agocpu/microwatt: update copyright
Florent Kermarrec [Tue, 17 Dec 2019 08:27:19 +0000 (09:27 +0100)]
cpu/microwatt: update copyright

4 years agocpu/microwatt: drive stall signal (no burst support)
Florent Kermarrec [Mon, 16 Dec 2019 11:37:27 +0000 (12:37 +0100)]
cpu/microwatt: drive stall signal (no burst support)