Commit Graph

305 Commits

Author SHA1 Message Date
Cary R e1870acfac Return the correct value when a queue or darray references an undefined element 2020-07-22 21:47:37 -07:00
Cary R dd80607ceb Add CA version of the <-> operator 2020-07-09 01:45:43 -07:00
Martin Whitaker 085f466377 Fix GitHub issue #337 - incorrect uninitialised function return value. 2020-06-25 00:31:43 +01:00
Martin Whitaker 5cd0ba08b1 Fix alloc size warning when building with recent GCC. 2018-10-06 23:25:13 +01:00
Scott Mansell 7b84b29bbc tgt-vvp: Output semicolon after .port_info statements
Backwards compatablity is perserved due to the parser interperting the
unexpected semicolon as an empty statement.
2017-12-16 23:59:48 +13:00
Cary R 3fc9ad2db0 Add support for the wild compare operators ==? and !=? 2017-11-17 19:32:50 -08:00
Stephen Williams d44c814bab Remove .alias records from vvp generated code.
Net arrays can be handled by nets directly, instead of creating
.alias records.
2016-08-31 14:05:09 -07:00
Michele Castellana 9ad46044b4 Cleanup 2016-06-30 17:47:34 +02:00
Martin Whitaker 20104c92c8 Fix for GitHub issue #96 - support mixed constant/variable delays in vvp.
If all three rise/fall/decay delay values are constant, we can use
the vvp .delay statement variant that takes three literal numbers.
If not, we have to use the variant that takes three net inputs. If
some of the delay values are constant, we need to create constant
drivers for those delay inputs.
2016-04-02 19:55:56 +01:00
Johann Klammer d7736d7eba latch for vvp output 2016-03-11 23:44:06 +00:00
Stephen Williams 9a7f31c728 Functions that return strings pass the return value on the stack. 2016-03-01 15:38:28 -08:00
Cary R 7d21891147 Fix space issues. 2016-02-28 22:09:39 -08:00
Stephen Williams 469d4fefa7 Handle compressed assign to function return value. 2016-02-01 12:38:48 -08:00
Stephen Williams c114edfa6c Handle void functions with new .scope format. 2016-02-01 09:29:49 -08:00
Stephen Williams fac7de2133 Better handle some different function types in the .scope setup. 2016-01-31 16:16:02 -08:00
Stephen Williams 604a62379c Make .scope aware of return type, and extend %ret/vec4 operands
The .scope needs to be aware of return types so that the %call/vec4
function knows how to intialize the return value. We also need to
extend the %ret/vec4 to support writing parts of the return value.
2016-01-31 15:29:52 -08:00
Stephen Williams e435a879fc Add ability to read back return value / Add vec4 stacked user functions.
Also:
- handle functions as arguments to system tasks.
- Cleanup detect of signal as return value.
2016-01-24 18:36:26 -08:00
Stephen Williams 0c91a6b041 Add .ufunc/real functor to handle functions with return value on stack. 2016-01-17 16:23:28 -08:00
Stephen Williams bfc9cd8715 Make real functions in processes use parent stack for return value. 2016-01-10 17:09:33 -08:00
Cary R 6c91588d33 Fix some errors found with cppcheck 2015-11-02 00:14:29 -08: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
Cary R 02ee3874e7 Space/code cleanup and warn that vvp does not support S/R D-FF 2015-04-20 15:41:44 -07:00
Cary R b3425d6cf3 Report that 4-state dynamic arrays are not currently supported in vvp
Also fix some error code propagation issues.
2015-01-16 18:22:16 -08:00
Stephen Williams dec4cd5071 Handle arrays of class objects.
This goes all the way down to the vvp level, where we create support
for arrays of objects, generate the new code in the -tvvp code
generator, and elaborate the arrays in the first place.
2014-08-30 10:18:57 -07:00
Stephen Williams e8b8fcba57 Support declaring queue variables all the way to vvp.
Nothing actually useful happens here, but the declarations
are functional.
2014-08-21 16:44:45 -07:00
Cary R 0a6d75f1db Fix some cppcheck warnings (format string vs argument mismatches) 2014-08-01 18:55:44 -07:00
Stephen Williams d5fb0f4344 Handle some tricky conditions assignments to parts.
When for example assigning to foo[<x>] within a contitional, and
doing synthesis, we need to create a NetSubstitute device to manage
the l-value bit selects.
2014-07-14 16:46:58 -07:00
Larry Doolittle ae6743cf69 Easy changes for -Wmissing-prototypes 2014-07-10 14:07:30 -07:00
Stephen Williams 0f85bf0b9a Basic DFF asynchronous set/reset synthesis support. 2014-06-15 18:22:02 -07:00
Stephen Williams ccce9d9271 Merge branch 'master' into x-sizer5 2014-06-14 19:13:42 -07:00
Stephen Williams f8dc430fe5 Add synthesis support for casez statements.
This generates an EQZ LPM device that carries the case-z-ness to
the code generator.

Also add to the vvp code generator support for the EQZ device so
that the synthesis results can be simulated.

Account for the wildcard devices in the sizer.
2014-06-13 18:01:41 -07:00
Martin Whitaker 529e029abd Fix for GitHub issue #28 - Insufficient string escaping in vvp script.
" characters in strings must be escaped when the compiler writes a
quoted string to a vvp script. This patch fixes up a few places where
this wasn't being done.
2014-06-09 22:40:26 +01:00
Larry Doolittle 855bf9cfe8 Pick some low-hanging const fruit
Makes more of the code const-correct; there are still plenty of difficult-to-fix const problems left.
No behavior change expected.
2014-06-09 10:47:28 -07:00
Stephen Williams 3b3a4d3ddc vvp code generation for class methods in class scope. 2013-03-24 15:12:35 -07:00
Stephen Williams fb23493a98 Class methods down to the code generator
Emit the elaborated class methods. Also generate root scopes to
represent the classes in order to hold the methods. These scopes
can also in the future be used to implement static properties.
2013-03-24 15:12:35 -07:00
Stephen Williams 60cb78e4ab Add packages and their own scope.
This makes <pkg>::<name> work properly, and also makes the
package descriptions available through VPI.
2013-02-17 17:00:15 -08:00
Stephen Williams 751587e112 PV-to-concat belnding should use a strength-aware concat. 2013-02-02 10:44:16 -08:00
Stephen Williams 074055bc58 Implement static arrays of strings.
This means extending the vvp to add .array/str objects and
include instructions to access the array. Also add the parser
and code generator support.
2013-01-05 15:57:58 -08:00
Stephen Williams 860419a346 Draft run-time support for SystemVerilog class objects.
This provides the ivl_target.h interface for class definitions
and expressions, the vvp code generator support for class objects
and properties, and the vvp run time support. Trivial class objects
now seem to work.
2012-12-10 19:20:02 -08:00
Stephen Williams 3e7adbeda0 Stub class object variables.
Create stub class objects at the vvp level and generate the code
to invoke that stub. Implement the routines needed to implement
a test for null object references.
2012-12-10 19:13:43 -08:00
Cary R f01a106c25 Remove a space issue 2012-11-12 18:15:33 -08:00
Cary R 4cd295cbba Fix printf opcode argument mismatches in tgt-vvp (cppcheck) 2012-08-31 12:36:55 -07:00
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Stephen Williams 14f229de30 Parse support for dynamic arrays.
This includes limited support for dynamic arrays down to the code
generator, and some stubs in the vvp code generator and vvp run time.
2012-07-22 10:52:06 -07:00
Stephen Williams d48362b861 First pass at getting strings to work.
In vvp, create the .var/str variable for representing strings, and
handle strings in the $display system task.

Add to vvp threads the concept of a stack of strings. This is going to
be how complex objects are to me handled in the future: forth-like
operation stacks. Also add the first two instructions to minimally get
strings to work.

In the parser, handle the variable declaration and make it available
to the ivl_target.h code generator. The vvp code generator can use this
information to generate the code for new vvp support.
2012-07-22 10:52:06 -07:00
Andrew Stevens 9b3d20239a Extend VPI and build to for SIMetrix cosimulation
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).
2012-06-07 08:00:02 -07:00
Stephen Williams e7a974347e Handle packed array slices at module ports. 2012-05-22 17:31:26 -07:00
Stephen Williams 4287fc4b50 Handle l-value part select of packed arrays. 2012-02-10 18:48:12 -08:00
Cary R 36d298a2b6 Assert that sync/async set/clear are not supported for a DFF primitive.
Since synthesis is not currently supported we do not support/generate
sync/async set or clear control inputs. This is further complicated by
the fact that the VVP DFF primitive is not fully implemented.
2011-11-17 14:33:00 -08:00
Cary R 24b6264318 Remove wide input valgrind warnings.
Both UDPs and system functions use the wide input functor. This patch
modified the code generator to create a local net declaration for the
output net if we have either a delay or modpath connecting the output
to the true output. This is needed so that the wide input can be
cleaned up correctly.

Local real nets were also added to the local net pool when testing with
valgrind. This allows them to be cleaned up at the end.
2011-11-10 17:53:08 -08:00