Commit Graph

185 Commits

Author SHA1 Message Date
Lars-Peter Clausen 5ef847ea87 Support type parameters
SystemVerilog supports type parameters. These are similar to value
parameters, but they allow to pass a type to a module or similar when
instantiating it.

E.g.

```
module A #(parameter type T = int);
endmodule

module B;
  A #(.T(real)) i_a;
endmodule
```

Add support for handling type parameters.

For the vlog95 and vhdl backends type parameters, similar to typedefs, get
replaced with their actual value. For modules with non-local type
parameters for each module instance a unique module or architecture is
generated with the actual type.

Querying type parameters through VPI is not yet supported.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2022-12-11 13:50:14 -08:00
Lars-Peter Clausen 6ea7763c31 tgt-vlog95: Consider scopes with only localparams as unique
For modules with parameters the vlog95 backend generates one module
declaration for each module instance. This is done so that different values
for the module parameters can be supported.

Local parameters are guaranteed to have the same value for all module
instances though. Add support for detecting the case that all module
parameters are local parameters and in that case only create one shared
module declaration. This is similar to what the vhdl backend does.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2022-09-18 17:33:20 +02:00
Lars-Peter Clausen 167005f849 tgt-vlog95: Generate initializers for package variables
While a package can not have logic defined in it. It can have
variables with initializers. These initializers currently get
ignored when converting the package to a module in the
vlog95 backend.

Make sure packages are treated the same as modules here and
that the initializers are turned into initial blocks in the
generate vlog95 code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2022-03-05 15:29:34 +01:00
Cary R 60a77b08d2 Add compiler and the start of vvp support for ->> 2021-02-19 23:21:51 -08:00
Cary R 7dc65af362 Add support for zero-based variable index part selects in a CA 2021-01-11 23:26:34 -08:00
Cary R c978d28c09 Update main component Copyright to 2021 2021-01-10 14:32:30 -08:00
Cary R 32787bb973 Add support for SV edge 2021-01-07 01:22:49 -08:00
Cary R fbe42f13e2 Update tgt- directories with cppcheck suggested fixes 2021-01-02 13:31:26 -08:00
Cary R 1d318c4393 Update cppcheck to not run posix and add some -U flags 2021-01-02 13:23:59 -08:00
Martin Whitaker f4d22af4bd tgt-vlog95: fix assertion failure when function calls a void function 2020-12-13 22:46:47 +00:00
Cary R b1484a97e2 Generate a unique name for mutli output gates 2020-12-01 21:12:40 -08:00
Cary R 11f4e71dd0 Fix the vlog95 -> and <-> expression code for wide results 2020-12-01 00:04:00 -08:00
Cary R cf8222fcfe A queue does not have dimensions so just assume the base is 0 for an L-val 2020-07-26 14:02:37 -07:00
Cary R 83c86735bb Update vlog95 to not crash with queue maximum index 2020-07-17 02:19:36 -07:00
Cary R dd80607ceb Add CA version of the <-> operator 2020-07-09 01:45:43 -07:00
Cary R c003bcc59a Add support for <-> in constant and procedural contexts 2020-07-07 23:29:19 -07:00
Cary R fb237fb006 Update the user visible copyright to be 2020 2020-05-31 13:41:38 -07:00
Martin Whitaker 40d2a49b90 Update vlog95 target to handle buffers/tran_vps used to prevent port collapsing. 2020-05-07 23:05:52 +01:00
Martin Whitaker 3f49dfcd97 Fix translation of module path connection type in vlog95 target.
The target API needed to be changed to pass the connection type
through to the target code generator.
2020-04-02 12:40:59 +01:00
Huang Rui 11001f58d5
Thoroughly fix parallel installation issues
In PR #300, @xdch47 pointed out a stable way to fix parallel
installation problems.

This fix applied the method, thanks!

Signed-off-by: Huang Rui <vowstar@gmail.com>
2020-02-12 22:42:04 +08:00
Huang Rui c1229b7565 [5/20]tgt-vlog95:Remove useless $(INSTALL_DOC)
fix install timestamp check and Remove useless $(INSTALL_DOC)

Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294

Signed-off-by: Huang Rui <vowstar@gmail.com>
2020-02-12 22:08:40 +08:00
Martin Whitaker cab9526e6c vlog95 target: better solution for void functions with no arguments. 2019-11-09 20:14:57 +00:00
Martin Whitaker 39238fd1cd vlog95 target: ! operator does not require explicit type conversion. 2019-11-09 16:52:28 +00:00
Martin Whitaker 58aa08ab64 Handle SV void functions in vlog95 target. 2019-11-09 16:14:09 +00:00
Cary R ea4e41207c Update cppcheck standards that are checked 2019-09-30 22:14:15 -07:00
Cary R ba82ef463e Fix some always_* issues 2019-09-29 16:59:59 -07:00
Martin Whitaker 0d20c50de4 Fix typo in last commit. 2018-10-06 20:22:12 +01:00
Martin Whitaker f1608e163f Fix implicit fallthrough warnings when building with recent GCC. 2018-10-06 20:15:42 +01:00
Cary R e611e8acc0 Add support to convert always_comb/latch to vlog95 2017-12-03 20:17:42 -08:00
Cary R 585a0232cb Add preliminary support for always_comb, always_ff and always_latch 2017-11-20 07:50:05 -08:00
Cary R 3fc9ad2db0 Add support for the wild compare operators ==? and !=? 2017-11-17 19:32:50 -08:00
Martin Whitaker 8461e1d9c4 Fix vlog95 target to handle hierarchical references in root-level tasks. 2016-07-26 22:01:22 +01:00
Martin Whitaker b1b91f49c8 Update vlog95 target to handle timescales for root scope tasks/functions. 2016-07-23 00:10:01 +01:00
Martin Whitaker 9f88b26a67 Fix vlog95 target to handle delayed CA to vector part select. 2016-04-02 22:24:14 +01:00
Martin Whitaker 7c3cee5f7a Updated comment in tgt-vlog95 to reflect changes in variable initialization. 2016-03-19 14:47:38 +00:00
Martin Whitaker a5dac08a50 tgt-vlog95: Find the original signal when a port connection is cast. 2016-03-12 23:22:14 +00:00
Martin Whitaker 081f5e6960 tgt-vlog95: Fix infinite loop caused by searching the wrong scope. 2016-03-12 23:11:11 +00:00
Martin Whitaker 5d9a196819 tgt-vlog95: Handle variable initialisation in named blocks. 2016-03-12 23:06:54 +00:00
Martin Whitaker b4d438ea9f Fixed bug in vlog95 dff output when using asynchronous set. 2016-03-12 11:39:32 +00:00
Martin Whitaker c0542af6bf Updated copyright dates following previous patch. 2016-03-12 09:10:58 +00:00
Johann Klammer 89333fa3a5 add latch primitive for vlog95 2016-03-12 09:06:42 +00:00
Martin Whitaker ca02b3ae53 vlog95 target enhanced to support constant input to LPM_SUBSTITUTE. 2016-02-27 21:13:57 +00:00
Martin Whitaker f84f0535cf Renamed synthsplit to exposenodes.
This was needed to avoid automatically setting the synth flag in the
compiler.
2016-02-27 20:24:28 +00:00
Martin Whitaker a33255f0e0 Add support for LPM_SUBSTITUTE and wider LPM_MUX objects in vlog95 target. 2016-02-27 18:08:56 +00:00
Cary R a65c007fdb Fix some cppcheck warnings 2015-10-02 09:43:54 -07:00
Martin Whitaker 9f4b485c1c Updated copyright dates displayed for main programs and targets. 2015-08-17 22:05:08 +01:00
Martin Whitaker b242663cae Support negedge flip-flops in synthesis and in vvp.
Also extend the support for FF asynchronous set values to vvp and
fix the dff functor in vvp to correctly model asynchronous set/clr
behaviour.
2015-06-13 16:47:57 +01:00
Larry Doolittle 2739f83702 Spelling fixes in C and C++ comments 2015-06-04 15:00:29 -07:00
Martin Whitaker 61ace52f31 Fix vlog95 target to not output data types in port declarations.
This avoids variable redeclaration errors.
2015-05-18 23:16:53 +01:00
Martin Whitaker 45dc13e496 Use uintptr_t/intptr_t when casting between pointer and integer.
The code was using (unsigned) long, but a long is 32-bits in the
Windows 64-bit ABI.
2015-05-05 23:00:09 +01:00