Commit graph

177 commits

Author SHA1 Message Date
Florent Kermarrec
86178ed2d9 fhdl/verilog: Update Reserved Keywords (from IEEE 1800-2017) and minor cleanup. 2021-10-15 11:06:31 +02:00
Florent Kermarrec
adf30928d4 build/efinix/efinity: Simplify get_pin_direction with direction/name already set to signals when generating the verilog. 2021-10-14 19:12:00 +02:00
Florent Kermarrec
fd354c5759 gen/fhdl/memory: Fix dual clock memory pattern (previous pattern is no longer supported by Yosys), thanks @gregdavill.
See https://github.com/enjoy-digital/litex/issues/1003.
2021-10-13 11:33:43 +02:00
Florent Kermarrec
8fbd1b84a4 gen/fhdl: Use a local emit_verilog function for Memory.
With the various FPGA now supported, being able to generate valid verilog patterns
that will be infered correctly is now complicated.

Use our local version of emit_verilog to be able to specialize more easily the generated
code.

This will also allow use to progressively remplace Migen's Memory.
2021-10-13 10:58:49 +02:00
Florent Kermarrec
269b84eca4 build/efinix: Move tweaked Memory to build/efinix for now. 2021-10-13 09:51:47 +02:00
Franck Jullien
b24475b07d Add an hacked no we memory for Efinix
Efinity synthesizer cannot infer RAM blocks with write enable.
In order to workaround this (at least for the Litex SoC intergrated
RAM/ROM) a dirty modified Memory class has been created.

This class needs to be rewrite !
2021-09-22 09:47:51 +02:00
Florent Kermarrec
b2f8fa5464 gen/fhdl/verilog: Make DummyAttrTranslate a dict. 2021-07-15 16:48:24 +02:00
Florent Kermarrec
bdc32171fd gen/fhdl/verilog/_printattr: Avoid trying translating attribute when not supported by Toolchain. 2021-07-15 09:57:15 +02:00
Florent Kermarrec
275932f56c gen/fhdl/verilog: improve clock domain error reporting. 2020-11-10 13:27:29 +01:00
Florent Kermarrec
e52ffd2da0 gen: add specify SPDX License identifier and specify file is part of Migen and has been modified/adapted for LiteX. 2020-08-23 15:19:46 +02:00
Xiretza
fcc7058bfc
Fix DeprecationWarning for collections.abc
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
2020-08-22 13:39:30 +02:00
Florent Kermarrec
eeea30eada litex/gen: remove io that has been replaced with litex/build/io (and should have been removed). 2020-07-07 08:14:42 +02:00
Florent Kermarrec
b057858071 gen/fhdl/verilog: explicitly define input/output/inout wires.
When integrating designs which set `default_nettype none, the top also needs
to explicitly define the type of the signals.
2020-05-05 16:58:33 +02:00
Florent Kermarrec
8e014f76da litex/build: move io.py from litex/gen and re-import DifferentialInput/Output, DDRInput/Output contributed to Migen.
This will make things easier and more consistent, all special IO primitives are now in LiteX.
2020-04-10 08:47:07 +02:00
Florent Kermarrec
72c8d590fa litex/gen: add io with SDRInput/SDROutput (if not overrided, register is supposed to be infered). 2020-04-09 16:23:27 +02:00
Florent Kermarrec
d92bd8ffaa gen/fhdl/verilog: fix signed init values 2020-01-12 22:06:35 +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
b845755995 gen/fhdl/verilog: allow single element verilog inline attribute 2019-08-28 05:24:11 +02:00
Florent Kermarrec
daa4307d9e add CONTRIBUTORS file and add copyright header to all files 2019-06-23 23:23:56 +02:00
Florent Kermarrec
68f12495cf soc/integration: also add sha-1/date to generated software files 2019-04-23 13:17:54 +02:00
Florent Kermarrec
425741226c build: add sha-1/date to generated verilog, change git_version to git_revision 2019-04-23 12:59:25 +02:00
Florent Kermarrec
99578bc68c gen/sim/core: add args support on Display 2018-12-09 09:46:10 +01:00
Florent Kermarrec
fa260f5b42 gen/fhdl: add simulation Display, Finish support.
In some simulation cases, it's easier to add debug traces directly in the code
than in the verilog/Migen testbench. This adds support for verilog $display in
Migen code.

Being able to terminate a simulation from the code is also useful, this also
add support for verilog $finish.
2018-12-09 09:45:17 +01:00
Florent Kermarrec
bf3b4eec34 gen: integrate migen changes 2018-12-04 21:06:51 +01:00
Florent Kermarrec
b796853893 gen: add common with reverse_bits/reverse_bytes functions 2018-10-30 10:15:29 +01:00
Florent Kermarrec
6048a5291c build/lattice/prjtrellis: modify generated verilog instead of creating a wrapper, handle inouts.
nextpnr expects TRELLIS_IO on all ios, it's not possible to ensure that with a wrapper.
We now just modify the generated verilog to insert the io constraints and TRELLIS_IOs.
2018-10-30 08:54:30 +01:00
Florent Kermarrec
c506c9752c gen/fhdl/verilog: set direction to io signals 2018-10-29 11:41:04 +01:00
Florent Kermarrec
c3652935d9 build: use our own fhdl/verilog code (needed to avoid combinatorial loop in simulation) 2018-05-01 12:02:54 +02:00
Florent Kermarrec
d7c7474670 gen/sim: fix import to use litex simulator instead of migen simulator 2018-04-04 15:40:53 +02:00
Florent Kermarrec
1925ba176f replace litex.gen imports with migen imports 2018-02-23 13:38:19 +01:00
Florent Kermarrec
43164b9a2c remove migen fork from litex 2018-02-23 13:37:26 +01:00
Sergiusz Bazanski
21bd26dcdd Allow for multiple synthesis directives in specials.
This is needed to specify timing constraints on some Lattice Diamond
library specials, like the EHXPLLL.

To keep backwards compatibility we allow the directive to still be a
single string. If it's not, we assume it's an iterable.
2018-01-23 00:27:49 +00:00
William D. Jones
ff0ad9a622 fhdl/tracer: Import Python 3.5/3.6 version guards from Migen. 2017-12-29 19:56:52 -05:00
Florent Kermarrec
e42ab27f30 gen/fhdl/verilog: revert _printcomb_simulation and _printcomb_regular (needed for icarus simulation) and add Finish command 2017-09-13 13:47:25 +02:00
Florent Kermarrec
9509d9e361 gen/genlib/cdc/gearbox: fix possible pointers overlap by removing AsyncResetSynchronizers.
read/write clocks don't have the same frequencies, using AsyncResetSynchronizers cause differents delay when releasing reset and can cause pointers overlap.
2017-07-24 13:39:08 +02:00
Florent Kermarrec
fe535db5ab merge migen ee0e709 changes 2017-07-04 08:15:40 +02:00
Florent Kermarrec
f5a971a8d8 soc/interconnect/stream: use reset_less attr of signal for payload and param 2017-06-28 23:10:45 +02:00
Florent Kermarrec
bd876d4cd6 merge migen 9a6fdea3 changes 2017-06-28 22:47:13 +02:00
Florent Kermarrec
4ea7026747 gen/fhdl/specials: revert migen's commit d98502c6 (specials/Memory: homogenize read-only port syntax) since causing a regression with litepcie 2017-06-10 21:53:53 +02:00
Florent Kermarrec
a36986a501 gen/fhdl/verilog: list available clock domains on keyerror 2017-06-05 14:33:46 +02:00
Florent Kermarrec
931ea5ac75 gen/genlib/cdc/gearbox: remove TODO since code is already a good compromise
latency can't be reduced that much and reducing ressource usage (already low) would introduce unneeded complexity.
2017-06-01 19:00:22 +02:00
Florent Kermarrec
ff2a9c2176 gen/genlib/cdc/gearbox: add more margin on pointers (for cases where clocks are not perfectly aligned) 2017-05-31 13:23:31 +02:00
Florent Kermarrec
bb582619eb gen/genlib/cdc: cleanup lcm computation, fix timeout on BusSynchronizer 2017-04-25 15:13:47 +02:00
Florent Kermarrec
0daeff8689 gen/sim/core: do not use reset_less clock_domains for the one that are created (logic may need to access reset signal) 2017-04-25 10:56:19 +02:00
Florent Kermarrec
456cce3ec6 gen/genlib/cdc: import gcd from math and not fractions (deprecated) 2017-04-25 10:55:13 +02:00
Florent Kermarrec
4c7d460475 litex/gen/util/misc: import gcd from math and not fractions (deprecated) 2017-04-24 19:25:24 +02:00
Florent Kermarrec
f73eb5fe71 gen/genlib/misc: add BitSlip 2017-04-19 09:55:19 +02:00
Florent Kermarrec
b708b9cfba gen/genlib/cdc: add gearbox 2017-04-19 09:54:51 +02:00
Florent Kermarrec
ff31959aea merge most of misoc 54e1ef82 and migen e93d0601 changes 2017-01-13 03:55:00 +01:00
Florent Kermarrec
f0202db90f gen/genlib/cdc: add GrayDecoder from misoc 2017-01-12 04:15:33 +01:00
Robert Jordens
677243bd8c ElasticBuffer: infer reset 2016-10-14 09:43:09 +02:00
Florent Kermarrec
4362e5c528 gen/genlib/cdc: add ElasticBuffer 2016-10-13 17:04:39 +02:00
Florent Kermarrec
6a35337a09 gen/sim/vcd: allow continous update of vcd file and dynamic signals
With continous update, VCD header needs to be writen at the beginning of the simulation.
When a new signal is created, we rewrite the header and the content.
2016-05-28 10:25:48 +02:00
Florent Kermarrec
65f74959b3 gen/sim/core: add Display support 2016-05-18 15:47:10 +02:00
Florent Kermarrec
6fe3e1237d gen/fhdl/structure: fix Display 2016-05-18 12:41:29 +02:00
Florent Kermarrec
69f0035315 gen/fhdl: add Display for debug in simulation 2016-04-29 23:03:43 +02:00
Florent Kermarrec
42767286ca gen/fhdl/verilog: add do in reserved_keywords 2016-04-27 17:43:25 +02:00
Florent Kermarrec
f6e1c45d57 gen/genlib/record: fix connect 2016-04-21 19:05:01 +02:00
Florent Kermarrec
e80cfedd7f gen/genlib/record: fix connect 2016-04-21 12:16:26 +02:00
Florent Kermarrec
c330e7be49 gen/genlib/record: rename leave_out by omit and add keep parameter to Record.connect 2016-04-21 09:39:12 +02:00
Florent Kermarrec
f512971d9e gen/sim: hack to update vcd output file during simulation (allow visualizing progress directly and having a vcd file even when simulation fails or doesn't stop) 2016-03-25 13:22:26 +01:00
Florent Kermarrec
0ef1d44c44 gen/sim, fhdl: remove port.we_granularity limitation on simulations
We have to find a way to eliminate all replaced memory ports from specials,
here we use a workaround and remove remaining _MemPorts before simulating.

If possible, proper way would be to remove replaced ports from specials.
Another solution can to remove all ports that are no longer associated with
a Memory.
2016-03-23 09:46:54 +01:00
Florent Kermarrec
5e16516706 gen: add missing sim files 2016-03-21 23:52:52 +01:00
Florent Kermarrec
dd2397b57c gen: remove vpi (no longer used) 2016-03-21 20:07:03 +01:00
Florent Kermarrec
703b30e078 gen/build: merge with migen 0575c749e35a7180f0dca408e426af8eef22b568 and reintegrate migen simulator
* fhdl/visit: determinism
* structure/Case/makedefault: fix corner cases
* fhdl/tools: apply lowerer to specials in deterministic order
* fhdl/verilog: fix variable name conflict
* fhdl/verilog: simpler names for IOs. Closes #40
* fhdl/namer: deterministic naming of signals with name_override
* use https url for m-labs.hk
* pipistrello: make PMOD an extension header
* vivado: find clock nets by get_nets, not get_ports
* build: support platform-independent false path designation
* sim: add more signals to VCD (#36)
* build/xilinx: fix error message when Xilinx toolchain directory exists but does not contain a ISE version directory. Closes #39
* kc705: make xadc an extension header
* kc705: add xadc/ams gpios
* Merge branch 'master' of github.com:m-labs/migen
* conda: fix for conda-build > 1.19
* platforms/kc705: enable on-die termination for user_sma_clock
* README: update
* Revert "conda: use BUILDNUMBER from environment."
This reverts commit b2eedfd2e24f0b83c2fb118a3f98cf349b256e91.
* conda: use BUILDNUMBER from environment.
* typo
* Exception now has helpful string.
* README: remove outdated build badge
* sim: run MemoryToArray before lowering specials
* fhdl/simplify/MemoryToArray: remove spurious memory ports from specials
* sim: make unlowered specials an error
* sim: lower specials, closes #34
* sim: support evaluating Replicate()
* Revert "README.md->rst"
* Prevent backslashes in (Windows) paths from being escaped by OpenOCD's TCL implementation.
* Revert "conda: run tests as a part of package build."
* Revert "setuptools: include examples as migen.examples."
* Revert "test: also look for examples in [.../dist-packages]/migen/examples/."
* conda: use source from the current checkout.
* travis: disable (superseded by our buildbot).
* test: also look for examples in [.../dist-packages]/migen/examples/.
* setuptools: include examples as migen.examples.
* conda: run tests as a part of package build.
* build: return to current working directory after building
* sim/vcd: support signals not appearing in FHDL
* sim: deterministic clock iteration
* sim: add support for passive generators
* fhdl/structure: fix last test in _Value.__bool__ (a instead of b)
2016-03-21 19:15:40 +01:00
Florent Kermarrec
34b45e3618 gen/build: use verilog 2001-style synthesis attributes for vivado (will need rework) 2016-02-11 22:54:26 +01:00
Florent Kermarrec
b7a1888a36 gen/fhdl/verilog: add regular comb parameter to allow implementation of simulation code (for icarus)
We will remove that when we will be using new migen simulator
2015-12-02 14:16:23 +01:00
Florent Kermarrec
a716c562f0 gen/build: use name_override for all IOs defined in Platform file (avoid random naming of IOs) 2015-11-30 18:26:33 +01:00
Florent Kermarrec
6fd0b73817 build: remove edif support 2015-11-16 16:26:38 +01:00
Florent Kermarrec
e407a1cdda gen/fhdl/verilog: remove asic_syntax and expose reg_initialization, dummy_signal and blocking_assign 2015-11-16 16:18:09 +01:00
Florent Kermarrec
16ba646b1b add TODOs 2015-11-14 03:15:10 +01:00
Florent Kermarrec
fc3ffe87ac for now use our fork of migen (to be able to simulate our designs) 2015-11-13 18:31:46 +01:00
Florent Kermarrec
ae3d54499a litex/gen: reintegrate migen with modifications to be able to simulate with vpi until all missing features of the new simulator are implemented 2015-11-13 14:44:16 +01:00
Florent Kermarrec
619cd8e695 avoid forking migen, we will add custom modules in litex/gen but will use upstream migen for common modules 2015-11-11 12:10:55 +01:00
Florent Kermarrec
6a0f85dc42 litex: reorganize things, first work working version 2015-11-07 17:48:55 +01:00
Florent Kermarrec
637634f312 import migen in litex/gen 2015-11-07 12:22:32 +01:00