Commit Graph

1612 Commits

Author SHA1 Message Date
Sean Cross 58598d4fda integration: svd: move svd generation to `export`
It was suggested that we should move svd generation into `export`,
alongside the rest of the generators such as csv, json, and h.  This
performs this move, while keeping a compatible `generate_svd()` function
inside `soc/doc/`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-02-04 23:49:08 +08:00
Sean Cross 73ed7e564c soc: doc: use sphinx toctree as it was intended
The sphinx toctree was behaving oddly, and so previously we were
ignoring it completely.  This patch causes it to be used correctly,
which removes the need for double-including various sections.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-02-04 20:34:10 +08:00
Sean Cross 7c3bc0b09f litex-doc: initial merge of lxsocdoc
lxsocdoc enables automatic documentation of litex projects, including
automatic generation of SVD files.

This merges the existing lxsocdoc distribution into the `soc/doc` directory.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-02-04 20:14:41 +08:00
Piotr Binkowski f3b068e2ee tools/litex_sim: use l2_reverse flag 2020-02-03 12:03:57 +01:00
Florent Kermarrec 3350d33f9c wishbone/Cache: add reverse parameter 2020-01-31 19:31:33 +01:00
Florent Kermarrec eff9caee6a soc_sdram: add l2_reverse parameter 2020-01-31 19:18:07 +01:00
Vadim Kaushan de88ed282a
Fix argument descriptions 2020-01-31 18:54:25 +03:00
Vadim Kaushan eb49ec217e
Pass --csr-json to the Builder 2020-01-31 18:53:50 +03:00
Florent Kermarrec b69f2993e4 soc_core: add UART bridge support (simplify having to do it externally) 2020-01-31 15:12:18 +01:00
Florent Kermarrec 7a6c04db9e build/altera/quartus: fix fmt_r typo 2020-01-30 13:55:13 +01:00
Florent Kermarrec c6b9676db8 cpu/minerva: update (use new nMigen API) 2020-01-30 13:42:02 +01:00
Florent Kermarrec 9d2894727e inteconnect/stream: use PipeValid implementation for Buffer 2020-01-30 09:36:04 +01:00
Florent Kermarrec 1c88c0f896 inteconnect/stream: cleanup 2020-01-30 09:32:04 +01:00
enjoy-digital cafd9c358a
Merge pull request #366 from gsomlo/gls-csr-followup
software, integration/export: (re-)expose CSR subregister accessors
2020-01-30 08:18:12 +01:00
Gabriel Somlo ff2775c264 software, integration/export: (re-)expose CSR subregister accessors
Expose a pair of `csr_[read|write]_simple()` subregister accessors, and
restore the way dedicated accessors are generated in "generated/csr.h"
to use hard-coded combinations of shifts and subregister accessor calls.

This restores downstream ability to override CSR handling at the
subregister accessor level.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-01-29 14:29:24 -05:00
Florent Kermarrec f3f9808d1f interconnect/stream: add PipeValid and PipeWait to cut timing paths. 2020-01-29 18:27:29 +01:00
Florent Kermarrec b22ad1acfb build/xilinx/vivado: improve readability of generated tcl/xdc files 2020-01-29 16:27:18 +01:00
Florent Kermarrec 7bc34a9bc7 integration/soc_core: revert integrate_sram_size default value (cause issues when using External SPRAM).
When using SoCCore, integrated SRAM can be disabled with integrated_sram_size=0 if not wanted.
2020-01-29 08:31:41 +01:00
Piotr Binkowski c02dd5e8f9 tools/litex_sim: add ddr4 PhySettings 2020-01-28 14:28:24 +01:00
Florent Kermarrec 0820adbda1 tools/litex_sim: add --sdram-init parameter 2020-01-27 21:30:13 +01:00
Florent Kermarrec 01ae10b803 software/bios: revert M-Labs MiSoC copyright. 2020-01-27 13:12:37 +01:00
Florent Kermarrec ea5ef8c1be README: update copyright year and make sure LICENSE/README both mention MiSoC 2020-01-27 12:15:11 +01:00
Florent Kermarrec 95cfa6a82c platforms/netv2: add pcie pins 2020-01-27 08:25:57 +01:00
Greg Davill 1f43906236 soc/software/bios/sdram: ECP5 move strobe dly_sel 2020-01-26 09:55:38 +10:30
Greg Davill f84f57d651 soc/software/bios/sdram: On ECP5 strobe dly_sel after read leveling 2020-01-25 13:11:39 +10:30
Florent Kermarrec 52765488b5 tools/litex_sim: update copyrights and cosmetic changes 2020-01-24 13:58:49 +01:00
enjoy-digital b280bb2ff2
Merge pull request #358 from antmicro/litex_sim_ddr
tools/litex_sim: add support for other sdram types
2020-01-24 13:33:03 +01:00
Piotr Binkowski 9aa97c2e0c tools/litex_sim: add support for other sdram types (DDR, LPDDR, DDR2, DDR3)
Right now litex_sim supports only SDR memories because it uses hardcoded
PhySettings. With this change PhySettings will be generated based on
selected sdram type which will allow us to use all the different types
of sdram chips in simulation.
2020-01-24 12:30:35 +01:00
Florent Kermarrec 19ef19ce0d cores/clock/create_clkout: rename clk_ce to ce, improve error reporting 2020-01-24 09:10:31 +01:00
enjoy-digital 7e08836062
Merge pull request #357 from betrusted-io/add_clk_ce
Add clk ce
2020-01-24 09:01:57 +01:00
bunnie 1f7549b4c0 add BUFIO to clockgen buffer options 2020-01-24 15:01:13 +08:00
bunnie b3f9aa11be add option for BUFGCE to the clock generator buffer types 2020-01-24 14:58:51 +08:00
Florent Kermarrec cbc081c43d tools/litex_sim: review/cleanup sdram-module/sdram-data-width features. 2020-01-23 15:42:47 +01:00
enjoy-digital b35ea459e7
Merge pull request #354 from antmicro/litex_sim_ddr
tools/litex_sim: specify dram chip and data width via commandline
2020-01-23 15:34:53 +01:00
Piotr Binkowski 674cfcde7d tools/litex_sim: specify dram chip and data width via commandline
litex_sim used a single predefined DRAM chip, with this it is now
possible to specify which one to use with --sdram-module and also
its data bus width can be set using --sdram-data-width
2020-01-23 14:41:37 +01:00
enjoy-digital b23f13d960
Merge pull request #351 from antmicro/fix_sram_size_argument
Fix sram size argument
2020-01-23 14:16:02 +01:00
Mateusz Holenko 7a05353aa7 soc_core: rename integrated_sram_size argument
To keep a consistent naming scheme across all arguments.
2020-01-23 13:46:09 +01:00
Mateusz Holenko c4bb4169f1 soc_core: fix integrated_sram_size argument type
Right now it's kept as a string and crashes
when trying to do math operations on it.
2020-01-23 13:45:16 +01:00
Florent Kermarrec 5845df76cc build/xilinx/vivado: add pre_placement/pre_routing commands 2020-01-21 19:00:58 +01:00
Florent Kermarrec 1388088240 cores/icap: add add_timing_constraints method 2020-01-21 14:08:36 +01:00
Florent Kermarrec 2074a86ee3 cores/dna: cleanup and add add_timing_constraints method 2020-01-21 14:08:17 +01:00
Florent Kermarrec d39dc8cf5d tools/litex_sim: cleanup/simplify 2020-01-20 21:22:41 +01:00
Florent Kermarrec a0d95766ac build/sim: add -Wl,--no-as-needed to LDFLAGS for Ubuntu 16.04 support (thanks kamejoko80) 2020-01-20 12:55:38 +01:00
Florent Kermarrec 80c3dc41d3 targets: use mem_region.origin instead of mem_map definition (prepare for automatic mem_region allocation) 2020-01-20 12:10:00 +01:00
Florent Kermarrec 53bc18cc3f soc_core: add new alloc_mem/add_mem_region to allow automatic allocation of memory regions
With add_memory_region, user needs to provide the memory origin, which should not be needed since
could be retrieved from mem_map and prevent automatic allocation which is already possible for csr
and interrupts.

New add_mem_region method now allows both: defining the memory origin in mem_map (which will then
be used) or let the SoC builder automatically find and allocate a memory region.
2020-01-20 12:05:08 +01:00
bunnie eae0e00496 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.
2020-01-19 20:57:14 +01:00
Florent Kermarrec 008a089471 targets/nexys4ddr: fix typo 2020-01-17 13:17:08 +01:00
Florent Kermarrec 36e5274a2b SoCSDRAM: set default max_sdram_size to 1GB (maximum we can map with current mem_map) 2020-01-17 12:45:23 +01:00
Florent Kermarrec 46c1c5c16f targets/kcu105: remove main_ram_size_limit 2020-01-17 12:27:21 +01:00
Florent Kermarrec 5913c91caa SoCSDRAM: rename main_ram_size_limit to max_sdram_size and make it a parameter of SoCSDRAM, expose SoCSDRAM parameters to user 2020-01-17 12:16:08 +01:00
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