Emil J. Tywoniak
78cb10da69
improve mkdtemp error message
2025-02-26 12:06:54 +01:00
Emil J
b4a169527d
Merge pull request #4894 from YosysHQ/emil/abstract
...
Add `abstract` pass for formal verification
2025-02-25 11:16:37 +01:00
Akash Levy
08d33330c4
Flush log after every pass automatically
2025-02-24 23:19:18 -08:00
Jannis Harder
7cd822b7f5
rtlil: Add {from,to}_hdl_index methods to Wire
...
In the past we had the occasional bug due to some place not handling all
4 combinations of upto/downto and zero/nonzero start_offset correctly.
2025-02-18 17:08:45 +01:00
Akash Levy
cddfd1f12a
Formatting
2025-02-14 04:26:26 -08:00
Akash Levy
7d33fd463b
Add is_mostly_const to SigSpec
2025-02-13 11:11:33 -08:00
Akash Levy
993b23e747
Merge upstream
2025-02-03 09:33:16 -08:00
KrystalDelusion
31b00b4c72
celledges: Use b_width_capped for left shifts
...
`b_width_capped` already exists for preventing arithmetic overflow, limiting the value of `b_width` to 30. This just changes the left shifts to also use it.
The caveat of incorrect results for extremely large values of `a_width` still applies, as does the improbability of that actually happening.
This fixes #4844 (or at least, the floating point exception; the circuit still isn't valid but I think that's fine).
2025-01-31 11:03:33 +13:00
David Sawatzke
09ead2daa9
tcl: Update help message to clarify usage of `result.string`
...
In the current documentation, it's unclear if `result.string` serves as
an example of a string name. It is furthermore unclear what the purpose
of `result.string` is. Clarify this by adding a small explanation (and
fix a typo)
2025-01-28 09:42:39 +01:00
Akash Levy
83800df3aa
Merge pull request #48 from alaindargelas/tmp_file_vcd2fst
...
Tmp file for vcd2fst
2025-01-27 22:46:38 -08:00
Martin Povišer
1d57a7cf6b
macc_v2: Relax and fix cell check
2025-01-27 15:52:49 +01:00
Martin Povišer
aabb4ea1df
macc_v2: Fix checks and parameter padding
2025-01-27 13:08:19 +01:00
Martin Povišer
cb8f855f34
rtlil: Fix macc_v2 cell check
2025-01-24 12:38:03 +01:00
Martin Povišer
61450e8b6e
Update codebase for macc_v2
2025-01-24 12:38:03 +01:00
Martin Povišer
5882055899
macc_v2: Add C port
2025-01-24 12:38:03 +01:00
Martin Povišer
c5fd96ebb0
macc_v2: Start new cell
2025-01-24 12:38:03 +01:00
Martin Povišer
08394c51a2
rtlil: Add const append helper
2025-01-24 12:38:03 +01:00
Akash Levy
2e89aa572b
Fix logger
2025-01-23 14:59:24 -08:00
Akash Levy
33653c8a80
Don't SIGABRT on failure
2025-01-23 14:51:40 -08:00
Akash Levy
233ba09994
Smallfixes
2025-01-23 14:05:29 -08:00
Akash Levy
bd439fc524
Reapply "Merge upstream"
...
This reverts commit e73d51dbf0 .
2025-01-23 13:40:32 -08:00
Alain Dargelas
0965ee2859
Tmp file for vcd2fst
2025-01-21 16:05:24 -08:00
Akash Levy
e73d51dbf0
Revert "Merge upstream"
...
This reverts commit c58a50f880 , reversing
changes made to a1c3c98773 .
2025-01-21 05:28:36 -08:00
Akash Levy
c58a50f880
Merge upstream
2025-01-21 04:36:34 -08:00
Emil J
da5c20dcfb
Merge pull request #4849 from YosysHQ/emil/hashlib-merge-top-ops
...
hashlib: merge hash_ops with hash_top_ops for plugin compat
2025-01-21 12:09:27 +01:00
Miodrag Milanovic
d50849ea83
Copyright year update
2025-01-21 08:48:29 +01:00
Emil J. Tywoniak
aa01ef3312
hashlib: simplify loopback. NFC
2025-01-20 16:15:48 +01:00
N. Engelhardt
a5ba1d2eba
fix bugs in handling last id in hdlname to scopename conversion
2025-01-16 12:57:08 +01:00
N. Engelhardt
17d45796a6
ModuleHdlnameIndex: handle objects with private name and hdlname attribute
2025-01-15 15:50:10 +01:00
Emil J. Tywoniak
901935fbce
hashlib: merge hash_ops with hash_top_ops for plugin compat
2025-01-14 21:41:33 +01:00
Akash Levy
57bf3a6f51
Merge branch 'YosysHQ:main' into main
2025-01-14 08:38:59 -08:00
Emil J. Tywoniak
4dbef95792
mark all hash_top methods nodiscard
2025-01-14 12:48:59 +01:00
Emil J. Tywoniak
a58481e9b7
mark all hash_into methods nodiscard
2025-01-14 12:39:15 +01:00
Emil J. Tywoniak
a2805b15c9
hashlib: fix hash_obj_ops discarding hash value
2025-01-14 12:36:24 +01:00
Akash Levy
5c514e00a4
Sync with upstream
2025-01-13 17:20:59 -08:00
Akash Levy
737e95d3e9
Move signal outside Py_IsInitialized
2025-01-10 11:52:10 -08:00
Martin Povišer
ca0ace66bc
Merge pull request #4817 from povik/macc_v2-1
...
macc: Stop using the B port
2025-01-08 14:42:51 +01:00
Martin Povišer
652a1b9806
macc: Stop using the B port
...
The B port is for single-bit summands. These can just as well be
represented as an additional summand on the A port (which supports
summands of arbitrary width). An upcoming `$macc_v2` cell won't be
special-casing single-bit summands in any way.
In preparation, make the following changes:
* remove the `bit_ports` field from the `Macc` helper (instead add any
single-bit summands to `ports` next to other summands)
* leave `B` empty on cells emitted from `Macc::to_cell`
2025-01-08 13:03:35 +01:00
Akash Levy
8c06c01ab5
Merge branch 'YosysHQ:main' into main
2025-01-04 20:33:08 -05:00
mikesinouye
de9cb5a60c
Remove spurious prime
2025-01-02 11:05:30 -08:00
mikesinouye
1ae0d8432f
Approximately double the max hash table size
2025-01-02 08:59:11 -08:00
Akash Levy
4f41e01edc
const modifier for pool of SigBit -> SigSpec conversion causing linkage errors on Mac
2024-12-20 11:56:10 -08:00
Akash Levy
2508d45f0b
Use std::hash for RTLIL hashing
2024-12-19 21:54:57 -08:00
Akash Levy
1dcf75d175
Sync
2024-12-19 21:40:30 -08:00
Emil J
8fd40942e9
Merge pull request #4825 from YosysHQ/emil/fix-gcc-error-directive
...
yosys_common: fix gcc warning in #error directive
2024-12-19 16:29:03 +01:00
Emil J. Tywoniak
cea5326229
yosys_common: fix gcc warning in #error directive
2024-12-19 15:55:51 +01:00
Emil J. Tywoniak
a6bd8ff3e5
yw: fix unintensional recursion in hash_into
2024-12-19 11:47:34 +01:00
Emil J. Tywoniak
026e9dae9d
hashlib: fixes from jix
2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
ed70038aa1
hashlib: fixes from jix
2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
b9b9515bb0
hashlib: hash_eat -> hash_into
2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
0a525f38c2
hashlib: declare YS_HASHING_VERSION = 1
2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
1df8a3e64b
hashlib: legacy mkhash_add -> djb2_add
2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
4e29ec1854
hashlib: acc -> eat
2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
79acc141d5
hashlib: add deprecated mkhash function to prevent plugin breakage
2024-12-18 14:58:53 +01:00
Emil J. Tywoniak
ad0dc17711
docs: document the ideas behind the hashing interface
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
0dafe06cd4
hashlib: run_hash uses hash_top_ops, not hash_ops
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
02a578365a
hashlib: remove is_new from HasherDJB32, implement hash_top for IdString
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
704a58ab21
hashlib: restore hash_obj_ops for pointers to indexed types
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
52b0fc03b7
hash: solo hashing interface, override for SigBit
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
b7991ed1f5
hashlib: prevent naive hashing of IdString when hashing SigBit
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
4d14399749
hashlib: allow forcing Hasher state, use it for IdString trivial hashing
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
c1af19fabc
hashlib: don't xorshift in between upper and lower word
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
209ab6fb72
hashlib: fudge always
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
582259f770
hashlib: hash_t can be set to 64-bit
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
b8738e2bd7
hashlib: use hash_t across the board
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
c73c88033d
hashlib: only include in one place
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
db04788c18
hashlib: fix pyosys
2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
953508f6d2
driver: add --hash-seed
2024-12-18 14:58:29 +01:00
Emil J. Tywoniak
d071489ab1
hashlib: redo interface for flexibility
2024-12-18 14:49:25 +01:00
Akash Levy
1eee11846e
Resolve reg naming to some extent
2024-12-17 12:11:39 -08:00
Akash Levy
0757e27683
Raise SIGABRT when assert fails
2024-12-17 09:58:54 -08:00
Akash Levy
dda4d9afce
Use basename for filename in id
2024-12-13 13:32:34 -08:00
Akash Levy
caaef5ac14
Merge branch 'YosysHQ:main' into main
2024-12-11 12:00:34 -08:00
Martin Povišer
1f718e3ab6
kernel: Remove global `tcl.h` include
...
In commit ac988cf we made sure to undefine the CONST/VOID macros left
defined by `tcl.h`, but this in turn makes it an issue to include
additional Tcl headers later on (see issue #4808 ).
One way out is to avoid a global `tcl.h` include. In the process we drop
support for Tcl-enabled MXE builds, which were likely broken anyway due
to the additional Tcl APIs used from `tclapi.cc`.
2024-12-10 13:49:08 +01:00
Akash Levy
d8fcc36f65
Smallfix
2024-12-09 19:09:29 -08:00
Akash Levy
78ceb23022
Use tcl.h instead
2024-12-09 17:32:25 -08:00
Akash Levy
1d0570a52c
Small tclapi fix
2024-12-09 16:46:06 -08:00
Akash Levy
2c5811daa1
Fix warnings
2024-12-09 11:45:09 -08:00
Akash Levy
e0ba08dd1d
Merge branch 'YosysHQ:main' into main
2024-12-09 11:13:47 -08:00
Martin Povišer
b0708a38bf
Merge pull request #4678 from povik/tcl-rtlil-api
...
Start Tcl design inspection methods
2024-12-09 15:44:58 +01:00
Akash Levy
8bb193d7c5
Merge branch 'YosysHQ:main' into main
2024-12-08 15:44:46 -08:00
N. Engelhardt
2a744b4b82
add hash method to scopeindex cursor
2024-12-06 11:18:39 +01:00
Alain Dargelas
fbf7734420
Excluded lbfd from MacOs build
2024-12-05 14:30:34 -08:00
Alain Dargelas
0e82550429
Support for backtrace
2024-12-05 13:29:27 -08:00
Akash Levy
4356eae4c9
Yosys sync
2024-12-04 14:16:55 -08:00
Krystine Sherwin
9925b27432
Goodbye guidelines (except GettingStarted)
...
Drop the parts that are being dropped.
Move the things that are being moved.
Also move the verilog stuff out of README and into the docs.
GettingStarted is less cut and dry, so hold off on that one.
2024-12-05 09:21:12 +13:00
Krystine Sherwin
f0da1cc67f
Start removing guidelines folder
...
Disable the export to docs and remove any references to the guidelines folder.
2024-12-05 09:18:56 +13:00
KrystalDelusion
c61b2bc1bc
Merge pull request #4794 from YosysHQ/krys/cygwin_compat
...
Fix Cygwin compatibility
2024-12-05 09:16:18 +13:00
KrystalDelusion
c96d02b204
Merge pull request #4784 from YosysHQ/krys/reduce_warnings
...
Reduce number of warnings
2024-12-05 09:16:06 +13:00
Emil J
d78086480f
Merge pull request #4770 from YosysHQ/emil/autoidx-option
...
driver: add --autoidx
2024-12-04 16:43:40 +01:00
Jannis Harder
81de54f436
tclapi: Remove unused -bool flag from get_param and document -[su]int
2024-12-03 18:59:52 +01:00
Jannis Harder
cac6dd9bcb
tclapi: Use older bignum API and handle external tommath for mac os
2024-12-03 18:49:38 +01:00
Krystine Sherwin
7d8140ddea
kernel/mem: Fix Cygwin compat
...
Avoid error:
```
kernel/mem.cc:1683:7: error: conflicting declaration ‘using addr_t = using addr_t = uint32_t’
1683 | using addr_t = MemContents::addr_t;
| ^~~~~~
In file included from /usr/include/sys/types.h:222,
from /usr/include/pthread.h:11,
from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/gthr-default.h:35,
from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/x86_64-pc-cygwin/bits/gthr.h:148,
from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/ext/atomicity.h:35,
from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/bits/cow_string.h:37,
from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/bits/basic_string.h:51,
from /usr/lib/gcc/x86_64-pc-cygwin/12/include/c++/string:53,
from ./kernel/yosys_common.h:27,
from ./kernel/yosys.h:42,
from ./kernel/mem.h:23,
from kernel/mem.cc:20:
/usr/include/machine/types.h:63:15: note: previous declaration as ‘typedef char* addr_t’
63 | typedef char *addr_t;
```
According to IntelliSense, only the return types need to be prefixed with `MemContents::`, the rest are automagically using the class definition and highlight as `using Yosys::MemContents::addr_t = uint32_t`.
2024-12-03 13:15:33 +13:00
Martin Povišer
f0704b6ede
Redo integer passing on top of bignum
2024-12-02 19:56:51 +01:00
Akash Levy
6e88c689f2
Merge branch 'YosysHQ:main' into main
2024-12-01 12:32:07 -05:00
Martin Povišer
1ded817beb
booth: Map simple `$macc` instances too
2024-12-01 16:00:04 +01:00
Krystine Sherwin
1de5d98ae2
Reduce comparisons of size_t and int
...
`Const::size()` returns int, so change iterators that use it to `auto` instead of `size_t`.
For cases where size is being explicitly cast to `int`, use the wrapper that we already have instead: `Yosys::GetSize()`.
2024-11-29 12:53:29 +13:00
Martin Povišer
646c5a19a8
Merge pull request #4776 from YosysHQ/krys/get_blackbox_attribute
...
Move get_blackbox_attribute method to Module instead of AttrObject
2024-11-28 00:25:16 +01:00
Martin Povišer
1717a0b9c0
Merge pull request #4721 from ldoolitt/main
...
kernel/drivertools.h: avoid maybe-uninitialized compile warnings
2024-11-28 00:09:43 +01:00
KrystalDelusion
f428163252
Move get_blackbox_attribute method to Module instead of AttrObject
2024-11-28 11:19:16 +13:00
Emil J. Tywoniak
65146e3acf
driver: add --autoidx
2024-11-26 12:11:10 +01:00
Akash Levy
52a1493548
Naming improvements
2024-11-21 03:29:35 -08:00
Akash Levy
bbbc292209
Smallfixes
2024-11-20 21:10:58 -08:00
Akash Levy
08ff023510
Naming fix for ff.cc
2024-11-20 20:59:04 -08:00
Akash Levy
1a69c51c88
Merge branch 'YosysHQ:main' into main
2024-11-18 16:10:30 -08:00
Martin Povišer
270846a49a
Merge pull request #4723 from povik/memv2-nordports
...
rtlil: Adjust internal check for `$mem_v2` cells
2024-11-18 15:44:39 +01:00
Martin Povišer
1cb5fd08b7
Merge pull request #4682 from povik/read_liberty-extensions
...
read_liberty extensions
2024-11-18 14:42:18 +01:00
Akash Levy
cb1640b873
Need this too
2024-11-16 21:55:54 -08:00
Akash Levy
6be73e5c2e
Updates
2024-11-15 19:02:06 -08:00
Martin Povišer
2dba345049
portarcs: New command to derive propagation arcs
2024-11-13 16:20:35 +01:00
Martin Povišer
4ce8c7a0d3
Merge pull request #4709 from YosysHQ/emil/idstring-in-fold
...
functional, glift: use fold overload of IdString::in instead of pool …
2024-11-13 15:17:33 +01:00
Martin Povišer
c7e8d41600
read_liberty: Set `area` `capacitance` attributes
2024-11-12 13:26:38 +01:00
Akash Levy
9f9bacc029
Fixes
2024-11-12 03:44:22 -08:00
Akash Levy
771e5c9996
Fix mem
2024-11-12 00:59:05 -08:00
Akash Levy
894c9816d3
Improve naming: big fix
2024-11-11 17:06:11 -08:00
Akash Levy
ea76abdaee
Merge
2024-11-11 11:47:58 -08:00
Robin Ole Heinemann
8bc4bd8a20
cxxrtl, fmt: escape double quotes in c strings
2024-11-11 18:49:05 +00:00
Larry Doolittle
3ae9ca7c2b
drivertools.h: switch from log_assert(0) to log_abort() for new feature
2024-11-08 10:30:11 -08:00
Martin Povišer
e82e5f8b13
rtlil: Adjust internal check for `$mem_v2` cells
...
There's a mismatch between what `kernel/mem.cc` emits for memories
with no read ports and what the internal RTLIL check expects.
The point of dispute it whether some of the parameters relating to read
ports have a zero-width value in this case. The `mem.cc` code says no,
the internal checker says yes.
Surveying the other `$mem_v2` parameters, and internal cell parameters
in general, I am inclined to side with the `mem.cc` code.
This breaks RTLIL compatibility but for an obscure edge case.
2024-11-08 15:18:43 +01:00
Larry Doolittle
d36a387aca
kernel/drivertools.h: avoid maybe-uninitialized compile warnings
...
Initialize "unsigned int inner" in hash() functions
Includes a log_assert() that might help catch corrupted data structures
or future incomplete modification of DriveType definition
2024-11-07 19:49:25 -08:00
Alain Dargelas
43186b2c7a
Returning unsigned int
2024-11-06 16:39:58 -08:00
Alain Dargelas
3ad51e06bc
Using Yosys hash
2024-11-06 16:32:18 -08:00
Alain Dargelas
39c2d7aa60
RTLIL Module dump and hash
2024-11-06 15:48:24 -08:00
Akash Levy
37914ff129
Merge branch 'YosysHQ:main' into main
2024-11-06 14:14:08 -08:00
N. Engelhardt
2de9f00368
Merge pull request #4620 from RCoeurjoly/fix-vcd-parsing-ghdl-var-spacing
2024-11-06 16:29:07 +01:00
N. Engelhardt
9068ec5566
Merge pull request #4627 from RCoeurjoly/roland/assume_x
2024-11-06 16:27:30 +01:00
Emil J. Tywoniak
387a235158
functional, glift: use fold overload of IdString::in instead of pool literals
2024-11-06 12:48:32 +01:00
Akash Levy
1cba744712
Update
2024-11-04 17:01:41 -08:00
Martin Povišer
cba9460cba
Split off Tcl APIs into `tclapi.cc`
2024-11-04 16:17:02 +01:00
Emil J
b2d78589e2
Merge pull request #4675 from YosysHQ/emil/pyosys-fix-segfault
...
yosys: fix pyosys initialization segfault
2024-11-01 16:40:58 +01:00
Akash Levy
d63c793e72
Merge branch 'YosysHQ:main' into main
2024-10-28 11:24:55 -07:00
Lofty
dd7ea0ab6c
qwp: remove
2024-10-25 14:09:58 +01:00
Akash Levy
7864c6dd34
vector fix for pyosys
2024-10-24 23:12:54 -07:00
Akash Levy
9ba609a7b0
Merge branch 'YosysHQ:main' into main
2024-10-21 16:28:19 -07:00
Emil J
7db4c65970
Merge pull request #4672 from YosysHQ/emil/fix-tcl-args-cxxopts
...
driver: fix special args passing to tcl and python
2024-10-21 15:41:24 +02:00
Martin Povišer
ccd98d21c1
Start Tcl design inspection methods
2024-10-21 13:32:03 +02:00
Akash Levy
0ddf964554
Merge branch 'YosysHQ:main' into main
2024-10-18 05:33:40 -07:00
Emil J. Tywoniak
37e61b993a
yosys: fix pyosys initialization segfault
2024-10-18 11:56:13 +02:00
Emil J
799497ebba
Merge pull request #4671 from YosysHQ/emil/const-deref-pyosys
...
py_wrap: implement nested class definitions
2024-10-18 11:46:12 +02:00
Emil J. Tywoniak
49d8a35c2e
rtlil: appease py_wrap
2024-10-18 11:31:20 +02:00
Akash Levy
6d4d6a6eff
Merge branch 'YosysHQ:main' into main
2024-10-17 10:26:17 -07:00
Emil J. Tywoniak
0341265e64
driver: fix special args passing to tcl and python
2024-10-16 23:56:45 +02:00
Emil J. Tywoniak
e9e67f381c
rtlil: remove trailing comma as pyosys workaround
2024-10-16 23:15:06 +02:00
Akash Levy
711e1f3164
Merge branch 'YosysHQ:main' into main
2024-10-16 13:21:03 -07:00
Krystine Sherwin
4ea6119734
cmdref: Move html only section inside cmd:def
...
Fixes missing links in body and `??` in tag/command index.
Update synth.rst to match.
2024-10-17 06:06:57 +13:00
alaindargelas
5019bd826d
Revert "auto name change until openSTA signal name parsing is fixed"
2024-10-15 18:36:37 -07:00
Akash Levy
1be0a50185
Fix comma that pyosys hates
2024-10-15 03:20:54 -07:00
Alain Dargelas
ecb9d3703b
auto name change until openSTA signal name parsing is fixed
2024-10-14 21:14:45 -07:00
Krystine Sherwin
b1025dbaa6
cellhelp.py: Cells can have tags
...
Tags are added to the list of properties when exporting to `cells.json`.
2024-10-15 07:35:41 +13:00
Krystine Sherwin
04b0ae540d
cellref: Move default help message to register.cc
...
Drop the default help message from rst while still displaying it on the command line.
Fix command line formatting for older style help messages.
2024-10-15 07:31:47 +13:00
Krystine Sherwin
b127ac07f8
Docs: Preliminary autocellgroup usage
...
Remove `/source/cell` from .gitignore.
Add a few initial cell pages.
Add YosysCellGroup documenter and cell:group directive.
Update Documenters to use nested json.
Better nested tocs for group.module.source layout.
2024-10-15 07:26:04 +13:00
Krystine Sherwin
7c5b10fe50
cellref: Add json dump
...
New `help -dump-cells-json <file>` to dump cells list.
Add 'group' field to SimHelper class/struct with defaults to gate_other and word_other depending on source (simcells or simlib).
Add 'unary' group to unary operator cells for testing (based on internal cell library docs page).
2024-10-15 07:25:27 +13:00
Krystine Sherwin
063a6bc2d7
register.cc: Include properties in docs
2024-10-15 07:23:45 +13:00
Krystine Sherwin
4c9c4c1419
celltypes.h: Add extra properties
2024-10-15 07:23:45 +13:00
Krystine Sherwin
21747c468c
Docs: Improve cell_help usage
...
- Drop `cell_code` and instead map code lookups to the `cell_help` dict.
- Add helper functions to struct for checking and getting the right cell.
- Add `CellType` for cell to `write_cell_rst` function declaration in
preparation for use in future.
- Iterate over `yosys_celltypes.cell_types` when exporting cell rst files,
reporting errors for any cells defined in `cell_types` but not
`cell_help_messages`.
2024-10-15 07:23:45 +13:00
Akash Levy
469f5a707a
Merge branch 'YosysHQ:main' into main
2024-10-14 11:21:54 -07:00
Krystine Sherwin
f9b4e04fef
Docs: Add cell reference
...
Subclass the command reference code in order to support smart references to the internal cells.
2024-10-15 07:17:36 +13:00
Krystine Sherwin
c98d134662
cellhelp: Extra newline
...
Fix `$macc` page.
2024-10-15 07:17:35 +13:00
Krystine Sherwin
d629aa6bf1
cellhelp: Split gate-level and word-level cells
2024-10-15 07:17:35 +13:00
Krystine Sherwin
57cd8d29db
cellhelp: Add default format parse for simcells
...
Since `simcells.v` uses consistent formatting we can handle it specifically to help tidy up sphinx warnings about the truth tables, and instead chuck them in a code block which when printing to rst.
Also has the side effect that rst code blocks can be added manually with `//- ::` followed by a blank line.
2024-10-15 07:16:40 +13:00
Krystine Sherwin
a2b2904ed8
cellhelp: Add source line to help
...
Include Source file and line number in SimHelper struct, and use it for verilog code caption in rst dump.
Also reformat python string conversion to iterate over a list of fields instead of repeating code for each.
2024-10-15 07:16:40 +13:00
Krystine Sherwin
784292626e
cellhelp: Rename short_desc to title
2024-10-15 07:16:39 +13:00
Krystine Sherwin
1e5a50ff3a
Docs: Convert write_cell_rst to use SimHelper
2024-10-15 07:16:39 +13:00
Krystine Sherwin
6bbe763845
Docs: Put cell library help strings into a struct
...
Allows for more expressive code when constructing help messages for cells.
Will also move extra logic in parsing help strings into the initial python parse instead of doing it in the C++ at export time.
2024-10-15 07:16:39 +13:00
Krystine Sherwin
a6641da73c
Docs: Initial version of cell_ref autogen
2024-10-15 07:16:39 +13:00
Emil J. Tywoniak
bc5d9d1bd3
functional: fix std::move usage in Factory::constant
2024-10-14 06:28:14 +02:00
Emil J. Tywoniak
785bd44da7
rtlil: represent Const strings as std::string
2024-10-14 06:28:12 +02:00
Akash Levy
8e6ac65dd8
Merge branch 'YosysHQ:main' into main
2024-10-13 10:59:19 -07:00
Emil J
61ed9b6263
Merge pull request #4608 from phsauter/rtlil-const-compress
...
rtlil: add Const::compress helper function
2024-10-12 20:38:25 -07:00
Akash Levy
db95ed6c77
Merge branch 'YosysHQ:main' into main
2024-10-12 16:02:50 -07:00
Emil J
5c9b2df689
Merge pull request #4616 from YosysHQ/emil/cxxopts
...
driver: replace getopt with cxxopts, replace -B, clean up help
2024-10-12 00:52:34 -07:00
Akash Levy
6725f2d646
Move init_share_dirname to after Python is initialized
2024-10-10 13:34:39 -07:00
Akash Levy
0ac341acf2
Merge latest and update yosys-slang dep
2024-10-09 15:34:02 -07:00
Philippe Sauter
c53c87e1f4
rtlil: add Const:: as_int_compressed function
2024-10-09 19:48:57 +02:00
Philippe Sauter
07fb8af05b
rtlil: handle all-zeros case in Const::compress
2024-10-09 19:48:57 +02:00
Philippe Sauter
4cd2e04da4
rtlil: add Const::compress helper function
...
Compresses the current bits to the minimum
width representation by removing leading bits.
2024-10-09 19:48:57 +02:00
Emil J. Tywoniak
575415ade2
driver: switch to cxxopts, replace -B
2024-10-09 15:21:34 +02:00
Mohamed Gaber
3d6b8b8e1a
wheels: fix missing yosys-abc/share directory
...
* `misc/__init__.py`:
* checks if there's a `yosys-abc` in the same directory - if yes, sets the variable `sys._pyosys_abc`
* checks if there's a `share` in the same directory - if yes, sets the variable `sys._pyosys_share_dirname`
* `yosys.cc::init_share_dirname`: check for `sys._pyosys_share_dirname`, use it at the highest priority if Python is enabled
* `yosys.cc::init_abc_executable_name`: check for `sys._pyosys_abc`, use it at at the highest priority if Python is enabled
* `Makefile`: add new target, `share`, to only create the extra targets
* `setup.py`: compile libyosys.so, yosys-abc and share, and copy them all as part of the pyosys build
* `test/arch/ecp5/add_sub.py`: ported `add_sub.ys` to Python to act as a test for the share directory and abc with Python wheels, used in CI
2024-10-09 13:09:14 +03:00
Martin Povišer
380a425598
Merge pull request #4639 from mikesinouye/hashlib
...
Explictly #include <variant> for std::variant usage.
2024-10-08 16:42:42 +02:00
Miodrag Milanović
535b3304cc
Merge pull request #4534 from donn/test_wheels
...
Pyosys Wheels
2024-10-08 11:24:16 +02:00
Mike Inouye
1e3973c5cb
Explictly #include <variant> for std::variant usage.
...
Signed-off-by: Mike Inouye <mikeinouye@google.com>
2024-10-07 21:57:30 +00:00
Akash Levy
fdc4c54c66
Merge branch 'YosysHQ:main' into main
2024-10-07 07:27:27 -10:00
Martin Povišer
e46cc57cc4
Merge pull request #4613 from povik/err-never-silence
...
log: Never silence `log_cmd_error`
2024-10-07 16:12:31 +02:00
Martin Povišer
74e92d10e8
Merge pull request #4593 from povik/aiger2
...
New aiger backend
2024-10-07 16:11:25 +02:00
Mohamed Gaber
407343a7a1
Pyosys Wheels
...
* Created `setup.py`: Python package manifest to build `pyosys` wheels with a custom extension to build and include `libyosys.so` using Make
* `.gitignore`: Added byproducts of the Python wheel build process
* `Makefile`: Added `-undefined dynamic_lookup` to `libyosys.so` so missing symbols can be resolved by importing into a Python interpreter
* `kernel/yosys.cc`: Gated `PyImport_AppendInittab` with `!Py_IsInitialized`; as of Python 3.12, the interpreter is already initialized and `PyImport_AppendInittab` would cause an exception to be raised
* Created `wheels.yml`: CI workflow for building wheels for CPython on:
* Linux (glibc, musl) and Darwin
* x86-64 and arm64
2024-10-07 16:39:54 +03:00
Emil J
1f517d6c7d
Merge pull request #4553 from donn/python_scriptfile
...
-y flag for libyosys Python scripts
2024-10-07 11:02:40 +02:00
Akash Levy
dd487ca8a1
Updating Yosys
2024-10-03 01:46:09 -07:00
Roland Coeurjoly
5ea2c6e6e5
Assume x values for missing signal data in FST
...
Co-authored-by: Miodrag Milanovic <mmicko@gmail.com>
Co-authored-by: Roland Coeurjoly <rolandcoeurjoly@gmail.com>
2024-10-02 12:08:48 +02:00
Akash Levy
ff0fd570d8
Revert mem but fix Verific frontend to remove ugliness
2024-10-02 01:17:01 -07:00
Akash Levy
afe3b18a04
Another try on mem fix
2024-10-01 21:57:59 -07:00
Akash Levy
73902607cd
Smallfix test
2024-10-01 07:46:56 -07:00
Akash Levy
af10f5e4f6
Update
2024-10-01 04:40:49 -07:00
Akash Levy
a0ebd9545a
Try again
2024-10-01 04:13:01 -07:00
Akash Levy
3b8bc8098f
Smallfix
2024-10-01 04:03:45 -07:00
Akash Levy
16b1eb1699
Update fix
2024-10-01 03:42:32 -07:00
Roland Coeurjoly
76c615b2ae
Fix: handle VCD variable references with and without whitespace
...
Co-authored-by: Miodrag Milanović <mmicko@gmail.com>
Co-authored-by: Roland Coeurjoly <rolandcoeurjoly@gmail.com>
2024-10-01 11:51:20 +02:00
Akash Levy
dd9687fc4c
Add way to disable memory init
2024-10-01 01:32:29 -07:00
Mohamed Gaber
35c8ad61ac
cli/python: error-checking, python interpreter bugfix
...
* Less brittle method of adding script dirname to sys.path
* Check if scriptfp successfully opens before using it
* Move `log_error` to after `PyErr_Print()` is called
2024-09-30 17:38:43 +03:00
Martin Povišer
3e3515e7d9
log: Never silence `log_cmd_error`
...
Add extra handling to arrange for `log_cmd_error` never being silenced
by the command line `-v N` option. Similar path for `log_error` exists
already.
2024-09-24 17:47:46 +02:00
Akash Levy
08fe6f66aa
Fix functional
2024-09-23 06:56:12 -07:00
Akash Levy
7d5dac7255
More apt location for whereami
2024-09-22 06:02:20 -07:00
Akash Levy
03f740e2a4
Undo annoying commit bdc43c6592
2024-09-18 22:05:23 -07:00
Akash Levy
db0317afc5
Add support for int stuff
2024-09-18 16:46:53 -07:00
Martin Povišer
3a1b003cc3
celltypes: Fix `$buf` eval
2024-09-18 16:55:02 +02:00
Akash Levy
9f44ec8aa1
Merge branch 'YosysHQ:main' into main
2024-09-17 15:24:05 -07:00
Martin Povišer
865df26fac
Adjust buf-normalized mode
2024-09-17 10:46:20 +02:00
Claire Xenia Wolf
80119386c0
Add RTLIL "buffered-normalized mode" and improve "bufnorm" pass
...
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2024-09-17 10:46:20 +02:00
Claire Xenia Wolf
d027ead4b5
Improvements in "bufnorm" pass
...
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2024-09-17 10:46:20 +02:00
Claire Xenia Wolf
4d469f461b
Add coarse-grain $buf buffer cell type
...
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2024-09-17 10:46:20 +02:00
Akash Levy
285c8a3f66
Merge branch 'YosysHQ:main' into main
2024-09-12 11:14:15 -07:00
N. Engelhardt
c8b42b7d48
Merge pull request #4538 from RCoeurjoly/verific_bounds
2024-09-12 13:04:04 +02:00
Mohamed Gaber
8dac27108e
Typos
2024-09-11 21:45:51 +03:00
Mohamed Gaber
738b5eef0b
Add dirname of script file to sys.path
...
This matches the behavior of running a Python interpreter, where the
first element of sys.path is the dirname of the script being run.
This allows importing of files and modules in the same directory without
messing with PYTHONPATH or similar.
2024-09-11 21:45:51 +03:00
Mohamed Gaber
38f9e6c3a2
-y flag for libyosys Python scripts
...
This adds a Python equivalent to the `-c` option, where scripts importing `libyosys` can be imported and used.
Most of the work for this was already done to enable Python passes a couple years back, so this is a relatively small changeset.
2024-09-11 21:45:51 +03:00
Roland Coeurjoly
bdc43c6592
Add left and right bound properties to wire. Add test. Fix printing
...
for signed attributes
Co-authored-by: N. Engelhardt <nak@yosyshq.com>
Co-authored-by: Roland Coeurjoly <rolandcoeurjoly@gmail.com>
2024-09-10 12:52:42 +02:00
Akash Levy
20c5ed2ebb
Merge latest
2024-09-06 07:43:14 -07:00
Miodrag Milanović
b20df72e1e
Merge pull request #4536 from YosysHQ/functional
...
Functional Backend
2024-09-06 10:05:04 +02:00
Akash Levy
cc3acb9894
Fix whereami extension
2024-09-05 22:13:28 -07:00
Akash Levy
63a7996cb4
Merge branch 'YosysHQ:main' into main
2024-09-05 17:07:57 -07:00
Akash Levy
ce95ec1f9e
Add VHDL support via GHDL call
2024-09-05 13:24:38 -07:00
Emil J. Tywoniak
bd6f7bb4a7
ff: improve comments
2024-09-05 11:17:12 +02:00
Emily Schmidt
4eeb8d326a
functional backend: rename "type" to either "kind" or "sort" to make the terminology consistent
2024-08-28 12:39:41 +01:00
Asherah Connor
94913a9f5a
cxxrtl: use octal encoding of non-printables.
...
"\x0a" is a perfectly valid escape sequence, but unfortunately "\x0ac"
is equivalent to "\xac", and not "\x0a" "c" as we might expect --- *any*
number of hexadecimal characters after the "\x" is accepted. This can be
hit pretty easily if a newline is present in a format string.
"\x{...}" syntax is only available as of C++23, so use octal format
instead; a maximum of 3 digits following the backslash is accepted.
The alternative would be to render every escape like `" "\x0a" "`, but
it seems more effort that way.
2024-08-27 17:41:52 +03:00
Emily Schmidt
b428bf4600
functional backends: identifiers in c++/smtlib may not start with digits
2024-08-27 13:10:34 +01:00
Emily Schmidt
459e6b913a
add functional ir documentation
2024-08-27 11:11:02 +01:00
Akash Levy
f707a3b6cd
Merge branch 'YosysHQ:main' into main
2024-08-26 22:37:42 -07:00
N. Engelhardt
0fc5812dcd
Merge pull request #4541 from YosysHQ/krys/compiler-warnings
...
Resolve (some) compiler warnings
2024-08-26 15:04:16 +02:00
Akash Levy
fe5c65a77e
Merge branch 'YosysHQ:main' into master
2024-08-22 15:44:55 -07:00
Emily Schmidt
761eff594f
functional backend: missing includes for stl containers
2024-08-22 11:13:58 +01:00
Emily Schmidt
9b5e81b13f
drivertools: fix C++20 "incomplete type" error by moving constructors below other definitions
2024-08-22 10:40:56 +01:00
Emily Schmidt
f456761e88
add sandia copyright notice to the functional backend
2024-08-21 11:04:11 +01:00
Emily Schmidt
831da51255
add picorv test to functional backend
2024-08-21 11:04:11 +01:00
Emily Schmidt
50047d25b3
functional backend: add different types of input/output/state variables
2024-08-21 11:04:11 +01:00
Emily Schmidt
79a1b691ea
silence some more warnings, undo mistaken addition
2024-08-21 11:04:11 +01:00
Emily Schmidt
8f77494263
silence some warnings
2024-08-21 11:04:11 +01:00
Emily Schmidt
fbee31080e
add optional header and hashlib implementation for optional
2024-08-21 11:04:11 +01:00
Emily Schmidt
850b3a6c29
convert class FunctionalIR to a namespace Functional, rename functionalir.h to functional.h, rename functional.h to compute_graph.h
2024-08-21 11:04:08 +01:00
Emily Schmidt
8c0f625c3a
functional backend: topological sort starts with the output and next states nodes, other nodes get deleted
2024-08-21 11:03:29 +01:00
Emily Schmidt
7ac0e92d35
functional backend: rename get_input and get_current_state to input and current_state (more consistent with other methods)
2024-08-21 11:03:29 +01:00
Emily Schmidt
99effb6789
add support for initializing registers and memories to the functional backend
2024-08-21 11:03:29 +01:00
Emily Schmidt
12a31a4418
add MemContents class to mem.h
2024-08-21 11:03:29 +01:00
Emily Schmidt
6d329e142d
functional backend: error out if multiply driven or undriven signals are seen, dont bother putting them in functionalir
2024-08-21 11:03:29 +01:00
Emily Schmidt
145af6f10d
fix memory handling in functional backend, add more error messages and comments for memory edgecases
2024-08-21 11:03:29 +01:00
Emily Schmidt
4722f13a5d
functional backend: reduce $lcu to $alu
2024-08-21 11:03:29 +01:00
Emily Schmidt
3cd5f4ed83
add support for RTLIL cells with multiple outputs to the functional backend, implement $fa,$lcu,$alu
2024-08-21 11:03:29 +01:00
Emily Schmidt
13bacc5c8f
eliminate pmux in functional backend
2024-08-21 11:03:29 +01:00
Emily Schmidt
c0c90c2c31
functional backend: require shift width == clog2(operand width)
2024-08-21 11:03:29 +01:00
Emily Schmidt
7f8f21b980
remove widths parameters from FunctionalIR factory methods and from functionalir.cc
2024-08-21 11:03:29 +01:00
Emily Schmidt
55c2c17853
document functionalir.h and change visitors to derive from AbstractVisitor. remove extraneous widths arguments from visitors.
2024-08-21 11:03:29 +01:00
Emily Schmidt
6922633b0b
fix a few bugs in the functional backend and refactor the testing
2024-08-21 11:03:29 +01:00