Commit Graph

6240 Commits

Author SHA1 Message Date
Cary R 0d9c04854f Fix reported Mac compile problem.
This patch removes the space between -L and the directory in the vpi
Makefile. It also fixes the line to use the correct variable name
for the LDFLAGS.
2011-07-08 18:19:57 -07:00
Pawel Szostek b376115e15 Add parser support for VHDL's null statements
Handle null statements in sequences of statements.
If a null is encountered, it is omitted and not
added to the list of statements.
2011-07-08 18:14:00 -07:00
Pawel Szostek ad31eaaea8 Add parser support for VHDL's procedure call
Parse procedure calls and put them into
abstract syntax tree. Elaboration and emission
still has to be done.
2011-07-08 18:10:30 -07:00
Pawel Szostek 721f9d5d9b Add String Expression to the VHDL parser 2011-07-08 18:05:06 -07:00
Pawel Szostek 88760b9982 Fix case-when VHDL statement 2011-07-08 17:59:55 -07:00
Prasad Joshi 4242e94a17 Function definition without return type
The patch allows parsing of function definitions which do not have
explicit data type or range. The default return data type is assumed
to be reg unsigned and the default range is 0.

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
2011-07-05 19:28:40 -07:00
Prasad Joshi e497c1f1dc Explicit 'reg' return type in function definition
Verilog allows returning variables of 'reg' type. The icarus verilog
implicitly assumes the default returned type of the function as
'reg unsigned'. The patch allows to explicitly specify the 'reg' return
type.

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
2011-07-05 19:28:27 -07:00
Cary R d07db53f0e Further update for the extern "C" declarations.
This patch wraps the routine declarations, etc. in an extern "C" block
instead of giving the individual routines an extern "C" definition.
2011-07-05 19:27:23 -07:00
Cary R f9a611c0cd C++ routines called from C must be defined as extern "C"
A C++ routine that is called from C code must be defined as extern "C".
Also clean up a couple other minor issues.
2011-07-05 19:27:17 -07:00
Prasad Joshi 045a1b9808 Add support for variable of primitive data type 'logic'
Verilog allows user to define variables of primitive types. The patch
adds support for defining variables of type 'logic'. The data type
'logic' is the only primitive data type which supports defining ranges.

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
2011-07-04 10:25:50 -07:00
Prasad Joshi f25b957006 Add support for variable of primitive data type 'bit'
Verilog allows user to define variables of primitive types. The patch
adds support for defining variables of type 'bit'. The data type 'bit'
is the only primitive data type which supports defining ranges.

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
2011-07-04 10:21:20 -07:00
Prasad Joshi 1d016c4c81 Add editor and tag file rules to .gitignore
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
2011-07-04 10:08:47 -07:00
Pawel Szostek 5934dcc17c Add parser support for vhdl's case-when
Case-when statements are now recognized and
turned into corresponding objects. Elaboration
and emission is still not done.
2011-06-30 19:57:27 -07:00
Pawel Szostek bdb851428a Fix minor bug in the vhdl lexor 2011-06-30 19:43:44 -07:00
Pawel Szostek bff0927db0 Add remaining tokens to vhdl lexor 2011-06-30 19:36:24 -07:00
Stephen Williams 6f10a02b40 Merge branch 'work6' 2011-06-29 19:56:50 -07:00
Cary R 019df7c7bf Some minor cleanup found with the latest cppcheck
Remove an unused variable (desired_vector_width) in elaborate.cc.
Reduce the scope of spin to make it obvious it is only used locally
in elaborate.cc. Initialize sel_type_ in the NetAssign_ constructor
(net_assign.cc). The code doesn't currently require this since
sel_type_ is only used when the base is not zero and it is always
defined when base is not zero, but giving this a default value in
the constructor hedges against accidentally using an undefined
value if someone checks the select type when the base is zero.
2011-06-26 11:24:00 -07:00
Cary R bc8704e47d Translate a BUFT device correctly in VHDL back end
When the BUFT device was added to the compiler nothing was done to
support it in the VHDL translator. This patch rectifies that oversight.
2011-06-26 11:20:54 -07:00
Cary R 85fd3a9005 Fix incorrect function in tgt-stub/expression.c.
This fixes a bug where the unary expression code was using the incorrect
function to check to see if the data type was real.
2011-06-26 11:19:33 -07:00
Cary R ad13fa89dc Remove space issues.
This patch just removes a few spacing issues.
2011-06-26 11:17:31 -07:00
Stephen Williams 91ffc68e95 Add $ivlh_attribute_event for VHDL support
The $ivlh_attribute_event system function helps the Verilog runtime
support <name>'event expressions in VHDL. The vhdlpp generates a
call to $ivlh_attribute_event, which in turn uses callbacks to handle
the support.

This is also the start of the vhdl_sys vpi module. This module should
by included whenever VHDL code is parsed.
2011-06-24 18:42:43 -07:00
Stephen Williams d14f60f28a Elaborate and emit vhdl elsif sections.
The IfStatement contains a list of elsif sections that need
to be elaborated/emitted in the middle of the true and false
clauses.
2011-06-22 18:13:40 -07:00
Stephen Williams e62b09d610 Fix uninitialized variable is vhdl Expression. 2011-06-13 17:46:05 -07:00
Stephen Williams 55dbbf8ee1 Merge branch 'master' into work6 2011-06-12 17:55:38 -07:00
Martin Whitaker 6ffd19cd7e vvp fix for pr3296466.
This patch reworks the tran island code to allow it to handle cases where
tran primitives cross-connect different bits of the same vector.
2011-06-12 17:36:07 -07:00
Martin Whitaker 4e86274ff2 Compiler fix for pr3296466.
The compiler was handling bi-directional pass switches using the default
case for primitive gates, where the first port is treated as an output
and the remaining ports are treated as inputs. This patch adds a special
case for pass switches, so that the first two ports are treated as
bi-directional.
2011-06-12 17:35:55 -07:00
Stephen Williams 41601696cc properly handle vhdl open ports in component instantiations. 2011-06-12 16:59:07 -07:00
Stephen Williams cab974c0c2 vhdl sequential l-values cause variables to be reg vs. net.
When a signal (or port) is assigned by a sequential assignment,
the signal or port becomes a reg, instead of a wire(net). Detect
this distinction during elaboration and generate the correct
signal/port declaration.
2011-06-12 15:38:03 -07:00
Stephen Williams 43b3df00c8 Better handle type probe of relation arguments. 2011-06-12 11:35:04 -07:00
Stephen Williams bf40c8ecc5 Conditional statements and expressions
Elaborate and emit a variety of conditional constructs.
Fix up type handling for some expression types
Elaborate continuous signal assignments.
2011-06-12 10:51:31 -07:00
Stephen Williams 2e28782af3 Add parser support for concatenations/conditional assignment/elsif
Some of these should be easy to translate, but get the parsing out
of the way first.
2011-06-05 13:58:54 -07:00
Cary R 3362fbc0db Always process specparams since they can be used outside a specify block.
The -gno-specify flag should only control the delay and timing checks.
It should not also remove the specparams since they can be used outside
of a specify block.
2011-06-04 10:45:44 -07:00
Martin Whitaker a45fa00479 Modified rules for primitive gate port expression widths.
The IEEE standard states that the port expressions used for arrays
of primitive gates must be the exact width required, but is silent
about the requirements for single instances. The consensus among
other simulators is that for input ports of single instances, the
expression is silently truncated to a single bit.

This patch also fixes a compiler crash if an error is found when
elaborating a primitive gate port expression.
2011-06-04 10:34:47 -07:00
Stephen Williams 788be63917 Merge branch 'master' into work6 2011-06-02 19:11:43 -07:00
Stephen Williams a4145534e4 Declare vhdl module ports inline, a la ansi-c
Keep the entity/component/module port declarations in the module port
list of the generated code. This clarifies the generated code and
fixes a couple bugs for more complicated types.
2011-06-02 19:11:20 -07:00
Stephen Williams 22ab8e4a76 Elaboration of r-value expressions
R-value expressions are more general then L-value expressions, in that
the expression type may be a bit more complex. If the R-value expression
is part of an assignment, then elaborate with the constrained type from
the L-value. In other cases, where the expression type is not as obvious,
use expression type probes to figure out the type of the expression and
elaborate using that calculated type.
2011-05-30 19:17:40 -07:00
Cary R feba73119a Update fstapi.c to match the latest from GTKWave 2011-05-29 09:05:04 -07:00
Martin Whitaker 6d0e5c2e89 Fix width calculation for expressions containing a specparam.
This patch adds code to properly calculate the type and width of a
specparam when it is used in an expression.

This patch also fixes a compiler crash when an unknown identifier is
used in a delay expression.
2011-05-29 08:55:46 -07:00
Cary R f3497e0c66 Report the correct gate port number.
The error message was reporting the error message as zero based
instead of one based.
2011-05-29 08:53:53 -07:00
Cary R 35488ac254 Fix bug in queue average with a very large number of entries.
Icarus is not actually fast enough to run into this issue in a
reasonable amount of time. I discovered this by thinking about
the algorithm and verified the fix with custom code.
2011-05-29 08:50:30 -07:00
Cary R c69f4ef7e0 Fix spelling problem reported in pr3301924 2011-05-29 08:48:19 -07:00
Martin Whitaker 767bb87ee2 Fix for pr3301924.
If a relative path name is passed to the Windows LoadModule function,
it is applied in turn to each path in the DLL search path. For the
ivl_dlopen function, we actually want to mimic the Unix behaviour,
where a relative path is relative to the current working directory.
On systems where the KB2264107 security fix has been applied, the
CWD is excluded from the DLL search path, so we no longer get the
required behaviour. This patch reworks the ivl_dlopen function to
give the correct behaviour under Windows.

This patch also adds a flush of the stderr stream after reporting
VPI call errors. This fixes a race between the stdout and stderr
streams when running the regression tests in a MinGW shell.
2011-05-29 08:47:47 -07:00
Cary R 6cad14c491 Add more comments to $table_model code, etc.
This patch mostly just adds comments, it also changes calles to
index() to strchr().
2011-05-29 08:42:49 -07:00
Stephen Williams da0fb1666f Detect always @edge patterns
VHDL doesn't have a direct way to express "always @(posedge...)"
statements, but we do want to detect common paradigms that naturally
translate. This makes for a better translation.
2011-05-28 10:49:33 -07:00
Stephen Williams a53082176d Arrange for ports used as l-values to be declared as "reg".
Entity output ports may be used as l-values in a process within
the bound architecture. Detect that case during elaboration and
adjust the signal declaration so that it works in the Verilog pass.
2011-05-15 16:17:51 -07:00
Stephen Williams fc25ccde06 Basic emit of sequential code
Infrastructure for debug and emit of sequential statements in processes.
This does not properly handle the actual semantics of the behavioral
code, but it provides an infrastructure where we can handle all the
tricky elaboration to come.
2011-05-15 11:07:42 -07:00
Stephen Williams 27b58a7f93 Reorganize architecture debug methods. 2011-05-15 08:57:19 -07:00
Stephen Williams 3e419dc854 Parse/decorate sequential statements.
Get to the point where our sample program parses completely, and
the sequential statements generate SequentialStmt objects and a
process object in the architecture.

Also add a few missing expression types.
2011-05-08 16:40:35 -07:00
Stephen Williams 7afd4210db Parse some sequential statements and processes. 2011-05-08 13:51:21 -07:00
Cary R b13c899b89 Some more $table_model() changes.
The code should be able to correctly parse any command string and
assign the appropriate values from the file to a structure that will
be used to add the information to the table structure.
2011-05-07 11:46:12 -07:00