Commit Graph

8056 Commits

Author SHA1 Message Date
Martin Whitaker 3fede95f5e Add support for real valued compressed assignment statements in tgt-vvp. 2016-02-23 20:58:30 +00:00
Martin Whitaker a7066e3686 Fix expression/operator type for compressed assignment/shift. 2016-02-23 20:57:30 +00:00
Martin Whitaker 0199ad129d Fix expression type for compressed assignment statements.
A compressed assignment statement should give exactly the same
result as the equivalent uncompressed statement. This means
that the type (signed/unsigned) of the LHS affects the type of
the RHS expression (unlike in normal assignments). We need to
take care that bit/part selects and concatenations are correctly
identified as unsigned values, even in the cases where they
reduce to a single whole signal.
2016-02-23 16:53:01 +00:00
Martin Whitaker 241b6723e5 Fix lval extension for compressed assignment in constant function.
The type of extension (zero/sign) is determined by the expression
type, not the operand type, so we need to cast to the expression
type before extending the value.
2016-02-23 16:46:26 +00:00
Martin Whitaker b77d758f19 Fix compressed assignments to concatenations.
When loading a lval concatenation, tgt-vvp was loading the elements
in the wrong order for the %concat instruction.
2016-02-23 16:44:03 +00:00
Martin Whitaker 1a78784205 Removed some dead code. 2016-02-23 11:58:27 +00:00
Martin Whitaker f9f51db7ba Extended constant function assignment operator support to real values.
Also output a "sorry" message if the LHS is a concatenation.
2016-02-22 23:31:35 +00:00
Martin Whitaker 74b8c04b91 Add support for SystemVerilog assignment operators in constant functions. 2016-02-22 22:22:22 +00:00
Stephen Williams bc23bc71e3 Merge branch 'master' of github.com:steveicarus/iverilog 2016-02-22 09:49:28 -08:00
Peter Jakobsen cbced021a1 Add missing symbols for dlltool to export 2016-02-22 09:49:06 -08:00
Martin Whitaker f3cf7ca546 Updated comments for synthesis. 2016-02-21 22:39:52 +00:00
Martin Whitaker f29935d8dd Enhanced support for asynchronous set/reset in synthesis.
Added the ability to coalesce set/reset values to different parts
of the same vector. Also added a check that all bits of the vector
are assigned a value.
Enabled coalescence of asynchronous set/reset part-vectors
2016-02-21 21:46:36 +00:00
Martin Whitaker 3fc0204b99 Fix cleanup of NetEvWait class.
The destructor needs to delete the stored NetEvent objects. Failure
to do this was causing a compiler crash after synthesis if the
nodangle functor was disabled.
2016-02-21 21:22:35 +00:00
Martin Whitaker 5286fb858d Synthesis rework.
Synthesis could only handle relatively simple conditional constructs.
This rework aims to make it handle anything the user can throw at it
(or output a sensible message as to why it can't).
2016-02-21 00:00:39 +00:00
Martin Whitaker 46105e0c5a Delayed output of vvp dff to end of current time slot.
Flip-flops are generally modelled in behavioural code using non-blocking
assignments. This change makes the synthesised code behave the same as
the behavioural code. It's a more realistic model of a real flip-flop
too, which will always have some clock-to-output delay.
2016-02-21 00:00:39 +00:00
Cary R 70a350f2e8 Merge branch 'master' of github.com:steveicarus/iverilog 2016-02-10 22:33:21 -08:00
Cary R 03cb74ba57 Fix compile warning 2016-02-10 22:33:10 -08:00
Maciej Suminski 71084109f6 Save the time format suffix string.
In case of a vhdlpp-specific () call, the timeformat suffix string was overridden,
therefore it has to be restored to the previous value after the call.
2016-02-10 22:33:06 -08:00
Stephen Williams 12c39aa4bb Fix broken "inherits dimensions from var/net" warning. 2016-02-10 10:56:14 -08:00
Stephen Williams 139c4154c3 Merge branch 'master' of github.com:steveicarus/iverilog 2016-02-06 16:08:15 -08:00
Stephen Williams f3647578d4 Add the -Wimplicit-dimensions warning. 2016-02-06 16:07:50 -08:00
Cary R eef3e8c09f Fix memory leak in time suffix code (VHDL) 2016-02-04 07:21:22 -08:00
Cary R 3e52b2be66 Fix valgrind compile 2016-02-03 22:25:57 -08:00
Cary R 841593d013 Remove some compile warnings 2016-02-03 21:40:18 -08:00
Stephen Williams 76ced1cf7c Fix %ret/* and %retload/* opcodes to search up for function thread. 2016-02-01 14:51:18 -08:00
Stephen Williams f494b478cc Merge branch 'master' into return-stack
# Conflicts:
#	sv_vpi_user.h
2016-02-01 14:47:44 -08:00
Stephen Williams 469d4fefa7 Handle compressed assign to function return value. 2016-02-01 12:38:48 -08:00
Stephen Williams ce692f90ad Implement and use the %retload/real opcode. 2016-02-01 09:31:06 -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
Martin Whitaker 83a82914e0 Temporary fix for br993 - assertion failure in flip-flop synthesis.
Synthesis does not currently support some commonly used styles for
representing flip-flops, e.g.

  q <= 0;
  if (en) q <= 1;

or

  if (clr) q <= 0;
  if (set) q <= 1;

For now, output a "sorry" message.
2016-01-30 22:38:08 +00:00
Martin Whitaker a006dee990 Fix for br994 - assertion failure when synthesising a mux.
The elaborator allows the RHS of assignment to be wider than the
LHS. When using an if statement to represent a mux, this meant the
mux inputs could be different widths, resulting in an assertion
failure during synthesis. The fix is to prune the RHS to match the
LHS for each assignment. This has the benefit of minimising the
mux width.
2016-01-30 20:11:58 +00:00
Martin Whitaker fbeee1bae3 Temporary fix for br995 - assignment to memory not supported in synthesis.
For now, output a "sorry" message.
2016-01-30 17:01:13 +00: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
Stephen Williams 37a63e5d6d Merge pull request #88 from orsonmmz/image_attr
'image attribute
2016-01-10 15:49:26 -08:00
Martin Whitaker eb2a9be0c9 Fix for br999 - incorrect result from binary comparison.
When a binary (in)equality comparison has a constant left operand,
the tgt-vvp code generator swaps the left and right operands to
allow the cmpi instruction to be used. The code for swapping the
operands was incorrect.
2016-01-07 19:11:42 +00:00
Maciej Suminski 32fab21e95 ivl: Allow concatenating strings returned by function calls. 2016-01-07 11:11:04 +01:00
Maciej Suminski ba274936e5 vhdlpp: Added 'image attribute for time type. 2016-01-06 15:30:24 +01:00
Maciej Suminski 214c940a1a vhdlpp: Fixing memory leaks and muting valgrind. 2016-01-06 15:30:20 +01:00
Maciej Suminski b711f16f05 vhdlpp: 'image attribute. 2016-01-06 15:30:06 +01:00
Maciej Suminski dff1ad08b0 vhdlpp: ExpAttribute split to Exp{Obj,Type}Attribute. 2016-01-06 15:30:06 +01:00
Maciej Suminski 71c63bf993 vhdlpp: Added argument_list token. 2016-01-06 15:30:06 +01:00
Maciej Suminski e0b2a5b337 vhdlpp: Refactored prange_t (class ExpRange). 2016-01-06 15:30:06 +01:00
Maciej Suminski 2c010d34bb vhdlpp: Unified Expression::evaluate() method. 2016-01-06 15:30:06 +01:00
Maciej Suminski 23633c498f vhdlpp: Moved dump_scope() to ScopeBase class. 2016-01-06 15:30:06 +01:00
Maciej Suminski 40075e11ab Code formatting. 2016-01-06 15:30:06 +01:00
Maciej Suminski 1d2aef7142 vpi: $sformatf() function. 2016-01-06 15:30:06 +01:00