Implement the string.len() method in the system.vpi, and implement the string[index] method in vvp.
Added: basic vpiPort VPI Objects for vpiModulkes vpiDirection, vpiPortIndex, vpiName, vpiSize attributes Since ports do not exist as net-like entities (nets either side module instance boundaries are in effect connect directly in the language front-ends internal representation) the port information is effectively just meta-data passed through t-dll interface and output as a additional annotation of module scopes in vvp. Added: vpiLocalParam attribute for vpiParameter VPI objects Added: support build for 32-bit target on 64-bit host (--with-m32 option to configure.in and minor tweaks to Makefiles and systemc-vpi).
This patch extends the compiler to support all specparam declarations allowed by the 1364-2005 standard. For compatibility with other simulators, it allows specparam values to be used in any constant expression, but outputs a warning message and disables run-time annotation of a specparam if it is used in an expression that must be evaluated at compile time.
When dynamic indexing of early dimensions is not needed, we can get pretty far with getting packed arrays to work.
For a parameter we want to keep the base definition file/line information not the file/line information for the override.
This patch changes the method used to signal that a constant expression is being elaborated from flags stored in global variables to flags passed down the call chain. It also generates more informative error messages when variable references are found in a constant expression.
Currently the compiler coerces input ports to inout ports whenever there is an internal driver connected to the internal port net. This generates an error if the port is externally connected to something other than a structural net. This patch modifies the compiler to ensure port coercion only occurs in valid cases.
This patch ensures that the result of a shift is an undefined value if the right operand is an undefined value. It also improves the code generated for right shifts where the right operand is constant and optimises away shifts where the right operand is a constant 0. It also fixes a few places where the expression type (signed/unsigned) was not being set correctly.
This is part of the 1800-2009 standard (Section 184.108.40.206) and allows ports of module instances to be declared like: modname instance(.foo, .bar); instead of modname instead(.foo(foo), .bar(bar)); The only tricky part about this is the implicit port connection shall not create an implicit net declaration. To make this happen, the path of least resistance was to add a bool to PEIdent indicating that it should not implicitely create a net. This does not rely on the generation flag to be 2009, following the trend that new port naming convention (like ANSI style ports) work regardless of the generation.
When handling the $signed/$unsigned system functions, the compiler was applying the new signed/unsigned property to the NetExpr object representing the input argument. This caused the input argument to be evaluated incorrectly. This patch fixes this by applying the new property to the NetExpr object created to pad the result to the required size. In testing this fix, it was also discovered that the width of the input argument expression was not being calculated correctly. This patch also fixes this issue.
Creation of implicit nets requires knowledge of whether an identifier has been declared before it is used. Currently implicit nets are created during elaboration, but by this stage the order of declaration and use is not known. This patch moves the creation of implicit nets into the parser stage.
This patch fixes a few bugs in constant bit/part selects and adds optional warnings for out of bound or undefined selects.
Under some situation the optimized repeat expression can get out of sync while it is being processed this causes the code to reference freed memory. This happens when the repeat expression is converted to an unsigned integer, but the repeat expression is used in a different path. It was easier to just remove the optimization then track down the convoluted call sequence that was causing this and then figure out what needed to be fixed. The repeat expression must be constant, so is likely not too complicated so this optimization is very minor and should not be missed.
This patch is a major rewrite of the indexed part selects (+: and -:). It made the following enhancements: 1. Make indexed part selects work correctly with both big and little endian vectors. 2. Add a warning flag that warns about constant out of bounds/or 'bx indexed selects. 3. Moved the -: parameter code to its own routine. 4. Added support for straddling before part selects in a CA. 5. Added more assert(! number_is_unknown) statements. 6. Add warning for &PV<> select with a signed index signal that is less than the width of an int. This will be fixed later. 7. Add support for loading a 'bx/'bz constant into a numeric register. 8. Add a number of signed value fixes to the compiler/code generator. 9. Major fix of draw_select_expr() in the code generator.
The test_width for repeat-concatenations is tricky because it requires the evaluated value for the repeat expression. It should be OK to call elab_and_eval on that expression even during the test_width for the containing expression. We'll see.
If the true and false alternatives are mixed types, then vectored arguments are treated as if in a self-determined context then cast to REAL.
This fixes up the elaboration of binary expressions found in parameter expressions. Parameter expressions are special because they elaborate early, before all the other parameters are necessarily completed.
The power (**) and shift operators are different from other binary operators because their expression width calculations rely only on their left operand, with their right operand self-determined. Get the handling of these operators out of the PEBinary base class to prevent confusion.