Commit Graph

49 Commits

Author SHA1 Message Date
Cary R a4a7b0a09d Make ivl_alloc.h the last include so it doesn't effect any system includes.
In ivl_alloc.h we redefine malloc(), realloc() and calloc() to have
standard error checking. We don't want to do this for anything that
comes from the standard headers. This specifically doesn't work if
a C++ header files does std::malloc, etc.

Also change to -W instead of -Wextra since that is more portable. I
plan to add a check from -Wextra and use it when available since it
is more descriptive.
2010-11-02 10:51:57 -07:00
Cary R cb86fb15bf Add error checking definitions for malloc(), realloc() and calloc()
This patch adds defines that translate all malloc(), realloc() and calloc()
calls into ones with error checking when ivl_alloc.h is included.
2010-10-14 17:39:23 -07:00
Stephen Williams ec49f10e2d Revert bad merge from vhdl branch 2010-10-02 11:02:27 -07:00
Cary R 1993bf6f69 Remove malloc.h support and for C++ files use <c...> include files.
The functions (malloc, free, etc.) that used to be provided in
malloc.h are now provided in cstdlib for C++ files and stdlib.h for
C files. Since we require a C99 compliant compiler it makes sense
that malloc.h is no longer needed.

This patch also modifies all the C++ files to use the <c...>
version of the standard C header files (e.g. <cstdlib> vs
<stdlib.h>). Some of the files used the C++ version and others did
not. There are still a few other header changes that could be done,
but this takes care of much of it.
2010-06-01 08:56:30 -07:00
Cary R d7ae1ed204 No need to have an if for a delete (found with cppcheck).
It is acceptable to call delete on a NULL object. It's also acceptable
to assign the value to zero if it is already zero. Removing the
superfluous if should produce slightly better code since there is no
conditional to deal with except for what is likely in the delete
implementation, but that should be highly optimized.
2010-04-23 11:40:35 -07:00
Stephen Williams 8cbff6def0 Cleanup various style issues.
This patch cleans up some style issues: no need to check that a value
is defined before freeing or deleting it, use C++ style casts, make
sure to NULL terminate strncpy(), empty() is faster than size() for
size == 0 or size >= 0 checks, re-scope some variables, etc.
2010-04-13 21:29:15 -07:00
Stephen Williams 79f8b8fcfd Remove Link::strength_t and PGate::strength_t types.
These types are useless repetition of the ivl_drive_t type.
This is also another chapter in the series to push ivl_target
generation further upstream.
2010-03-16 15:16:53 -07:00
Stephen Williams bf4e7454eb Account for output drive of LPM mux devices.
LPM devices, and LPM MUX devices in particular, need to
have their drive strength accounted for.
2010-03-16 14:25:00 -07:00
Stephen Williams 4622f304d5 Remove dead init values from NetNet and Link objects.
It turns out that although there was all kinds of code to manage
these members, there were no uses anywhere. It must have been a
legacy from a previous era. So remove the dead code so that it
doesn't confuse me again.
2009-12-11 13:44:29 -08:00
Stephen Williams 4cda5ae6e9 Clean up some optimizer formance around the fringes.
Remove some wasteful and excess scans of the Nexus of some links,
and remove dead code so we can see what we're doing. Also inline
some commonly used and trivial functions.
2009-12-11 07:56:27 -08:00
Stephen Williams 534207bb83 Optimized Nexus handling during code generation.
Once code generation starts, the Nexus structure no longer needs to
support fast insertion/connect operations. So have the code generator
lock down the Nexus structures and adjust the Link lists for optimal
access during readout.
2009-12-10 13:20:38 -08:00
Stephen Williams 782c55f7b5 Restructure Nexus lists of Links to handle large net lists.
When netlists get very large, the Nexus::connect() method tickles
the O(N) performance and elaboration gets very slow. Rework the
connect method to be O(C), for a drastic performance boost for
large designs.
2009-12-09 15:49:52 -08:00
Stephen Williams 4db4a467ee Speed up the connect(Nexus*,Link&) function somewhat.
This simplifies and reorganizes this function in order to improve
the performance of this function by a constant factor. I think we
really need to improve this by an entire order (and not just a
simple factor) but this helps.
2009-12-09 08:22:18 -08:00
Stephen Williams abc4eb9d52 Do not cprop through ternaries if the selector is an l-value.
It turns out that it is possible for an otherwise constant net
mux to be non-constant if there is a force that can drive the
net. This can be detected as an l-value reference to an otherwise
constant selector.
2009-10-05 19:46:47 -07:00
Stephen Williams fff2598709 Fix broken definition of is_linked(). 2009-03-06 10:19:46 -08:00
Stephen Williams a2aff77ca2 Avoid creating Nexus objects until they are really needed.
By not creating Nexus objects until necessary, we avoid creating a
lot of spurious objects. In fact, it is true that almost every
link that is created and connected to another link will create a
spurious Nexus object without this patch.
2009-01-07 22:07:08 -08:00
Larry Doolittle 3adcbb5611 Shadow reduction part 2
Continue cleaning up shadowed variables, flagged by turning on -Wshadow.
No intended change in functionality.  Patch looks right, and is tested
to compile and run on my machine.  No regressions in test suite.
2008-10-13 20:12:47 -07:00
Stephen Williams e4c9ad2b17 Remove redundant NetPins node pointer.
Remove redundant pointer to the containing NetPins object by keeping
the pointer only in the first Link (pin 0) of an array of links. In
this link, replace the pin number with the NetPins pointer, and set
a pins_zero_ flag to indicate that this has happened. This way, only
the first pin in a Link array will have the pointer to the NetPins
that contains the array, and the pointer takes up practically no space
at all.
2008-09-13 19:49:38 -07:00
Stephen Williams 3abf51dcad Get rid of names attached to Links.
This is simply no need for the names on links,
other then for debug messages, and there are
better ways to handle that.
2008-09-10 19:34:28 -07:00
Stephen Williams 5dfecb3789 Remove useless Link instance number. 2008-09-10 07:29:23 -07:00
Stephen Williams c9efe87146 Merge branch 'master' into elaborate-net-rework 2008-08-29 19:10:48 -07:00
Stephen Williams 1ca8241b88 Merge branch 'master' into verilog-ams 2008-08-29 19:03:34 -07:00
Stephen Williams 6051150c14 Continuous assign no longer uses elaborate_net.
convert the continuous assign elaboration to use elaborate_expr
and synthesize methods instead of the elaborate_net methods of
PExpr. This exposes problems with the synthesize methods, but it
is a better way to do it.
2008-08-11 21:21:33 -07:00
Stephen Williams 893aae2ca4 Add BUFZ to input ports when necessary.
When driving an input port to a module, watch out for the case where
the net is also driven within the instance. If this is the case, take
pains to make sure what goes on in the instance doesn't leak out
through the input port. Add a BUFZ (continuous assignment) to isolate
the context from internal driving.
2008-08-06 21:04:52 -07:00
Stephen Williams b292a5fc05 Create a branch object to be the argument to the access function.
The NetBranch object is connected, but not like an object, so the
NetPins object base class is factored out from NetObj to handle the
connectivity, and the NetBranch class uses the NetPins to connect a
branch.

Also, account for the fact that nets with a discipline are by default
real-valued.
2008-08-04 20:54:05 -07:00
Cary R f7e840cd0a Fix another delete[]/free problem.
This patch fixes a delete[] vs free problem in the NexusSet
class. The items_ array was being allocated with malloc/realloc
and freed with delete[]. The quick fix was to replace delete[]
with a call to free(). A better fix would probably be to rework
the class to use a vector.
2008-04-04 21:31:14 -07:00
Stephen Williams f1f2806e3c Get delays of signed extended continuous assignments right.
Padding and continuous assignment caused problems if the continuous
assignment includes a delay. The problem is that the padding was
not necessarily included in the delay. Rework the elaboration to
make sure the padding is indeed included in the delay.
2008-02-01 20:13:23 -08:00
Larry Doolittle 8ea3b6b0b8 header includes for gcc-4.3 compatibility
minimal changes required to build without error
tested with gcc-4.3 (Debian 4.3-20071130-1) 4.3.0 20071130 (experimental)
2008-01-04 16:14:44 -08:00
steve c7d97f4146 Properly evaluate scope path expressions. 2007-06-02 03:42:12 +00:00
steve fe8da0bf14 Remove pretense of general use for t_cookie. 2007-03-26 18:17:50 +00:00
steve d434dd7296 Allow part selects of memory words in l-values. 2006-02-02 02:43:57 +00:00
steve cf85c19f7b Simplify NexusSet set handling. 2005-09-25 23:40:11 +00:00
steve 4413dd3c81 Fix compile errors. 2005-06-13 23:22:37 +00:00
steve 365cfedd55 Update DFF support to new data flow. 2005-04-24 23:44:01 +00:00
steve 9e94afe399 Use PartSelect/PV and VP to handle part selects through ports. 2005-01-09 20:16:00 +00:00
steve 27af95d402 Use perm_strings for named langiage items. 2004-02-18 17:11:54 +00:00
steve f56d763411 Move strstream to ostringstream for compatibility. 2003-01-14 21:16:18 +00:00
steve 3d4593d4d5 Synthesizer support for synchronous begin-end blocks. 2002-10-21 01:42:08 +00:00
steve 2fad8d4cff Detect temporaries in sequential block synthesis. 2002-08-18 22:07:16 +00:00
steve 52bf4e613f conditional ident string using autoconfig. 2002-08-12 01:34:58 +00:00
steve 70abb2ce5c Clear drive cache on link or unlink. 2002-07-03 03:08:47 +00:00
steve 9b6b081e38 Add structure for asynchronous logic synthesis. 2002-06-30 02:21:31 +00:00
steve 58c2e12507 Make link_drive_constant cache its results in
the Nexus, to improve cprop performance.
2002-06-24 01:49:38 +00:00
steve b094bbdcf4 Add support for conbinational events by finding
the inputs to expressions and some statements.
 Get case and assignment statements working.
2002-04-21 04:59:07 +00:00
steve b825f8d2b2 Create a config.h.in file to hold all the config
junk, and support gcc 3.0. (Stephan Boettcher)
2001-07-25 03:10:48 +00:00
steve 6f69773c57 ivl_target updates, including more complete
handling of ivl_nexus_t objects. Much reduced
 dependencies on pointers to netlist objects.
2000-10-06 23:46:50 +00:00
steve 8876cda37f Get at gate information for ivl_target interface. 2000-08-26 00:54:03 +00:00
steve 42e4ff47c8 Move inital value handling from NetNet to Nexus
objects. This allows better propogation of inital
 values.

 Clean up constant propagation  a bit to account
 for regs that are not really values.
2000-07-14 06:12:56 +00:00
steve 583868e74e Redesign Links to include the Nexus class that
carries properties of the connected set of links.
2000-06-25 19:59:41 +00:00