Compare commits

...
2967 Commits
Author SHA1 Message Date
steve 87e813766a Detect and ignore specify edge expressions 2007-06-14 03:50:00 +00:00
steve e24e77660f Detect and use the nan function. 2007-06-13 01:03:57 +00:00
steve 8ec6d9983d Put instantiated modules in the proper generated scope. 2007-06-12 04:05:45 +00:00
steve ae82eccdc4 handle constant inf values. 2007-06-12 02:36:58 +00:00
steve fa18d9bc01 Do not propogate until initialized. 2007-06-12 02:25:00 +00:00
steve 16ec4cb685 displan pmos gates. 2007-06-12 02:23:40 +00:00
steve 6f08f92ffc Prepare for snapshot 20070608 2007-06-09 01:06:51 +00:00
steve 0a38499941 Properly handle signed conversion to real 2007-06-07 03:20:15 +00:00
steve 55f8e5d364 int vs long expressions on 64bit arch (ldoolitt) 2007-06-05 21:52:22 +00:00
steve b631268f56 Error resiliency (ldoolitt) 2007-06-05 21:35:51 +00:00
steve 1a8ffe2a9c More standard PLI_BYTE8. 2007-06-05 21:32:30 +00:00
steve e4bcc87dc1 Upward names may reference modules by module_name. 2007-06-05 04:18:09 +00:00
steve 34111a25cb Bring in .SFT file automatically if -m used. 2007-06-05 01:56:12 +00:00
steve 8fd42fbf61 Build errors in picky GCC compilers. 2007-06-04 19:14:06 +00:00
steve 129a064e1a Handle bit/part select of array words in nets. 2007-06-04 02:19:07 +00:00
steve c7d97f4146 Properly evaluate scope path expressions. 2007-06-02 03:42:12 +00:00
steve 1f9a246c6d Fix warning (ldolittle) 2007-05-31 18:36:06 +00:00
steve 17fd3bae15 Missing return value to perm_string dump 2007-05-31 18:35:50 +00:00
steve 29aa68302e Add elsif support (Martin Whitaker) 2007-05-30 23:21:20 +00:00
steve 8dcd09797f Fix uninitialized lineno variable. 2007-05-25 18:21:39 +00:00
steve ddd36ecb6c Rework the heirarchical identifier parse syntax and pform
to handle more general combinations of heirarch and bit selects.
2007-05-24 04:07:11 +00:00
steve 67b1eee7ce Better configuration messages (Alan Feldstein) 2007-05-16 23:59:12 +00:00
steve 629c6e9a40 Fix hname_t use of space for 1 perm_string. 2007-05-16 19:12:33 +00:00
steve 6ea1337be0 Trace file line buffer must be static. 2007-05-08 22:01:26 +00:00
steve b981c81d37 Rework hname_t to use perm_strings. 2007-04-26 03:06:21 +00:00
steve 210e28e571 Prepare for 20070421 snapshot. 2007-04-22 00:32:07 +00:00
steve f6ad90f8d3 Rename assign_list to cont_assign_list. 2007-04-21 04:45:36 +00:00
steve 890f592eec Fix detect of signal that is an array. 2007-04-21 03:20:47 +00:00
steve f9c1c02f8d Add support for -v flag in command file. 2007-04-19 02:52:53 +00:00
steve 26f47c26f0 Handle arrayed strength-aware net devices. 2007-04-19 01:19:06 +00:00
steve c0496ea648 Add support for multiple command files. (Cary R.) 2007-04-18 03:23:38 +00:00
steve 498d8fe6ad Add support for Gg and Ee formats. 2007-04-18 02:40:20 +00:00
steve dafc653935 Put to iverilog wiki for further notes. 2007-04-18 02:36:13 +00:00
steve 401faef5b8 Fix vpi_get_value vpiRealVal of signed constants. 2007-04-18 01:57:07 +00:00
steve 22efa9f066 Fix elaboration of multiply of two constants. 2007-04-18 01:40:49 +00:00
steve 583abb7f49 Fix handling calls to tasks in combinational always block 2007-04-17 04:34:23 +00:00
steve fe65ae8db0 Support part select of array words in net contexts. 2007-04-17 04:18:10 +00:00
steve cc48a6c8d7 Fix argument count in function error message. 2007-04-17 04:17:47 +00:00
steve 36471e9f96 Properly ignore unsupported ifnone. 2007-04-16 01:10:07 +00:00
steve 427d5664ef Fix missing zero if time value is exactly 0. 2007-04-16 00:47:12 +00:00
steve 253fdc6232 Fix scanf to abort on failed matches. 2007-04-16 00:09:58 +00:00
steve 79fdb2b243 Attach line number information to task calls. 2007-04-15 20:45:40 +00:00
steve 089bdefad1 Fix div/mod calculation that caused a hang for some divisions. 2007-04-15 02:07:24 +00:00
steve 8ed1a010f7 Allow bit/part select of vectors in continuous assignments. 2007-04-15 01:37:29 +00:00
steve 9931e4c013 Finish up part select of array words. 2007-04-14 04:43:01 +00:00
steve acdb278b97 Handle system functions with no arguments. 2007-04-14 03:27:51 +00:00
steve d3a54547aa Properly account for tri0 connected to otherwise open mux input. 2007-04-14 03:10:51 +00:00
steve f621448ced Parse edge sensitive paths without edge specifier. 2007-04-13 02:34:35 +00:00
steve 2229825783 fix handling of unary reduction logic in certain nets. 2007-04-12 05:21:54 +00:00
steve fb7ce1d330 Support for vpi_get_value of scaler values. (ravi@bluespec) 2007-04-12 04:45:52 +00:00
steve ff7625cd9c nexus vectors of VT_BOOL objects. (ravi@bluespec) 2007-04-12 04:40:37 +00:00
steve 8f9738719b Add support for vpiSize on system task handle. ([email protected]) 2007-04-12 04:33:39 +00:00
steve 31914c7fcd vpip_make_binary_const cannot free the string passed in to it. 2007-04-12 04:25:58 +00:00
steve abaeb1e702 Add printtimescale (caryr) 2007-04-12 02:50:51 +00:00
steve 513fa72d99 Cleanup timeformat argument checking. 2007-04-10 04:56:26 +00:00
steve 65baeaed8f vpi_free_object doesnot free callback out from under runtime. 2007-04-10 04:32:05 +00:00
steve fbc731d19e Allow nexus aliases to array words. 2007-04-10 03:40:04 +00:00
steve 5047a3add3 variable arrays generated without writing a record for each word. 2007-04-10 01:26:15 +00:00
steve d3588b4e23 More strict use of PLI_BYTE8 type. 2007-04-09 22:49:33 +00:00
steve 33e5f22cf1 Handle evaluate of addition of real valued constants. 2007-04-07 04:46:18 +00:00
steve af913e7eb1 Allow implicit wires in assign l-value. 2007-04-05 03:09:50 +00:00
steve dd995b3409 Probe of case statement inputs can skip nul statements. 2007-04-05 01:53:52 +00:00
steve a863b2390c Remove useless assert 2007-04-04 02:31:57 +00:00
steve c5524b4acf t-dll should not canonicalize word addresses, elaboration already does it. 2007-04-04 01:50:38 +00:00
steve d883979fd8 Seperate arrayness from word count 2007-04-02 01:12:34 +00:00
steve 37111eb4a8 Tighter parsing of statement lists and expression lists. 2007-04-01 23:02:03 +00:00
steve bd1b00ca29 Improve port mismatch error message. 2007-04-01 23:01:10 +00:00
steve 0168502bbb Get offsets into indexed part selects correct. 2007-04-01 05:28:26 +00:00
steve ea74940be4 Fix that save expression lookaside always clears cached variable values. 2007-04-01 05:26:17 +00:00
steve 8856c07d88 More efficient allocate of ivl_nexus_t objects. 2007-03-26 20:32:47 +00:00
steve 9e21880cdc Handle part select of array words. 2007-03-26 19:23:13 +00:00
steve fe8da0bf14 Remove pretense of general use for t_cookie. 2007-03-26 18:17:50 +00:00
steve fe02214fcc do not calculate nexus name unless needed. 2007-03-26 16:51:48 +00:00
steve 611d2c81b3 Spelling fixes from Larry 2007-03-22 16:08:14 +00:00
steve 96443f1338 Clear lookaside even if source bit is a constant. 2007-03-20 04:26:56 +00:00
steve 32fb919b00 Replace some asserts with ivl_asserts. 2007-03-14 05:06:49 +00:00
steve 72ec3a2c09 VPI tasks take PLI_BYTE* by the standard. 2007-03-14 04:05:51 +00:00
steve a50ec29ad9 Elaborate scopes of modules instantated in generate loops. 2007-03-08 06:11:35 +00:00
steve d9efe3312e Limit the calculated widths of constants. 2007-03-08 05:30:02 +00:00
steve 29b4d5a46e document the +integer-width plus-arg. 2007-03-08 03:06:47 +00:00
steve f23a5bfa96 Make integer width controllable. 2007-03-07 04:24:59 +00:00
steve 74ac5dbf58 Cast to remove ambiguities calling pow function. 2007-03-07 03:55:42 +00:00
steve ae88f5cc68 Lint fixes. 2007-03-07 00:38:15 +00:00
steve 760f2182ba Support signed function return values. 2007-03-06 05:22:49 +00:00
steve e6fa72c318 Handle processes within generate loops. 2007-03-05 05:59:10 +00:00
steve 8c434ca6fa Update spec file to be more suse compliant. 2007-03-04 20:49:49 +00:00
steve 6f810e0dba Assert that modpath finds a delay. 2007-03-04 06:26:58 +00:00
steve b68f17483e UDP schedules its output instead of pushing it. 2007-03-04 06:26:33 +00:00
steve 606751dbfd Check that path source/destination are ports. 2007-03-03 05:56:55 +00:00
steve fc9a90c9e0 Add support for edge sensitive spec paths. 2007-03-02 06:13:22 +00:00
steve b21390b228 Better error message when operating on array. 2007-03-02 01:55:36 +00:00
steve 1352eada12 Improved buildrequires and clean (Günter Dannoritzer) 2007-03-02 01:30:47 +00:00
steve 243cf94165 Add support for conditional specify delay paths. 2007-03-01 06:19:38 +00:00
steve e789b3a5cf Snapshot 20070227 2007-02-28 01:34:42 +00:00
steve bb02da0319 Better error message around repeat concatenation syntax. 2007-02-27 06:10:16 +00:00
steve 0946f40c7b Detect and warn about lval array index out fo bounds. 2007-02-27 05:14:38 +00:00
steve 80a2b05733 Do not assign to words constant-indexed out of range. 2007-02-27 05:13:34 +00:00
steve 6804732b9e Spelling fixes (larry doolittle) 2007-02-26 19:49:48 +00:00
steve d6969b719a Prevent lost of width while calculation address. 2007-02-26 01:51:40 +00:00
steve d2ba78559a Process Verilog escape sequences much earlier. 2007-02-25 23:08:24 +00:00
steve 1f54f128c1 Handle unary minus of real valued expressions. 2007-02-20 05:58:36 +00:00
steve 2c32a81d91 Improved version of pr1639064 patch handles huge values. (larry doolittle) 2007-02-19 01:45:56 +00:00
steve cd5b1b111c Fix print of integers as real. <larry Doolittle> 2007-02-18 06:01:25 +00:00
steve 9d4fc92df5 Get page size from sysconf. 2007-02-16 23:30:14 +00:00
steve 45307f6144 Handle type of ternary expressions properly. 2007-02-14 05:59:46 +00:00
steve 92c36f152d Treat BOOL and LOGIC the same according to VPI functions. 2007-02-14 05:59:24 +00:00
steve 4f74d9df98 Add the mov/wr opcode. 2007-02-14 05:58:14 +00:00
steve 0137832003 Include types for ternary and string in dump. 2007-02-14 05:57:51 +00:00
steve 189532c5bf Hande specparam with min/myp/max values. 2007-02-13 04:39:25 +00:00
steve 7d2d87f7c6 NAND output is inverted once AFTER AND is calculated. 2007-02-12 05:08:27 +00:00
steve 521f66f040 Get padding right when loading array word into big vector. 2007-02-12 04:37:58 +00:00
steve c1c2381261 Parse all specify paths to pform. 2007-02-12 01:52:21 +00:00
steve 97234cb7ca Lexor handle escaped slash in strings. 2007-02-09 05:19:04 +00:00
steve 3fd80b09f0 Administrative/Makefile fixes, mostly for windows. (Cary R.) 2007-02-06 05:07:31 +00:00
steve 2b3acfb344 Expression lookaside cannot hold complex expressions 2007-02-06 04:43:53 +00:00
steve 326329d497 Set some missing local flags. 2007-02-05 01:42:31 +00:00
steve d958a4a5af Handle relink of continuous assignment. 2007-02-05 01:08:10 +00:00
steve 7d42c50253 Lookaside is invalid when working a new scope. 2007-02-02 04:48:49 +00:00
steve 6d91be5b19 Use inttypes.h instead of stdint.h for portability. 2007-02-02 04:33:00 +00:00
steve d52f41535f Ternary output node is local. 2007-02-01 19:06:06 +00:00
steve a623502ece More generous handling of errors in blocks. 2007-02-01 05:52:24 +00:00
steve d22e9713f7 Error message better reflects more general reality. 2007-02-01 05:25:26 +00:00
steve 5869d7d879 Include type in signal create message. 2007-02-01 05:24:08 +00:00
steve 074a6a44e3 Detect and report arrays without index in net contexts. 2007-02-01 03:14:33 +00:00
steve 85ceea7358 Fix missing check for thread bits width in ADDI 2007-01-31 22:28:55 +00:00
steve b2e1db6adb Add method to bind assertions to verilog source lines. 2007-01-31 04:21:10 +00:00
steve 05efaa6427 Treat VPI argument array with constant index specially. 2007-01-30 05:28:23 +00:00
steve cfe2198e5e Types of task/function arguments set in multiple steps. 2007-01-29 02:07:34 +00:00
steve d175eb17f1 Clarify the use of ivl_scope_def for not-functions. 2007-01-29 01:52:51 +00:00
steve 2de8bafb5c Fix padding of x when literal is sized and unsigned. 2007-01-27 05:36:11 +00:00
steve 8e1c7e2891 More literal implementation of inertial delay model. 2007-01-26 05:15:41 +00:00
steve 8ae6240947 Snapshot 20070123 2007-01-24 01:24:47 +00:00
steve f77d803aeb Clean up elaboration of for-loop increment expression. 2007-01-21 04:26:36 +00:00
steve 4b829bf04f Get argument widths right for shift results. 2007-01-20 02:10:45 +00:00
steve 17a508047b Better size error details. 2007-01-20 02:09:54 +00:00
steve b350b14f93 DLL API changes for windows. 2007-01-19 23:49:33 +00:00
steve ca9da51a79 Precalculate constant power expressions, and constant function arguments. 2007-01-19 05:42:40 +00:00
steve 98417cb03a Fix calculation of verinum pow operation. 2007-01-19 05:42:04 +00:00
steve f07257067a Handle real constants in vector expressions. 2007-01-19 05:24:53 +00:00
steve e4d7eda02a Fix missing data_type mark for array words. 2007-01-19 04:26:24 +00:00
steve 4d8164945e Fix missing passive setting for array word pins. 2007-01-19 04:25:37 +00:00
steve c0954349e4 Fix bad lookaside references in vvp thread code generator. 2007-01-19 02:30:19 +00:00
steve e89b9fc25e Do not match array words in expression lookaside. 2007-01-18 00:59:48 +00:00
steve 11a83c352d Add missing array source files to CVS. 2007-01-18 00:24:10 +00:00
steve d8d7673d27 Fix typo is hello_vpi.c example. 2007-01-17 05:35:48 +00:00
steve 6f3ddce7c4 Dead code for memories in scopes. 2007-01-17 05:00:12 +00:00
steve f5a7ee0736 Remove dead code related to memories. 2007-01-17 04:39:18 +00:00
steve 91d84e7dc7 Major rework of array handling. Memories are replaced with the
more general concept of arrays. The NetMemory and NetEMemory
 classes are removed from the ivl core program, and the IVL_LPM_RAM
 lpm type is removed from the ivl_target API.
2007-01-16 05:44:14 +00:00
steve 5c3b2f4193 Snapshot 20061210 2006-12-10 17:18:56 +00:00
steve 0ae45e5644 Fix build error overloading pow function. 2006-12-10 17:15:48 +00:00
steve 296c2a575a Snapshot 20061209 2006-12-09 20:07:58 +00:00
steve 316422d93b Handle vpiRealVal reads of signals, and real anyedge events. 2006-12-09 19:06:53 +00:00
steve 2c7d2effd1 Fix an uninitialized variable warning. 2006-12-09 01:59:35 +00:00
steve 4fb5556d1c Handle very wide signed divide. 2006-12-08 19:56:09 +00:00
steve 2eeea7003e @* without inputs is an error. 2006-12-08 04:09:41 +00:00
steve d7de70bdeb Prevent name clash when processing parameter in net. 2006-12-08 03:43:26 +00:00
steve 078019ddec Parse the case of module arrays with port binding by name. 2006-12-06 05:32:36 +00:00
steve b4c3e8208f Parse bit selects in $setuphold notifiers. 2006-12-03 04:46:51 +00:00
steve 2f9a3e90ae Handle comments in file names. 2006-11-30 06:00:28 +00:00
steve 4f8a7ea84a Use new vvp_fun_XXX in place of old functor table for NAND/NOR/XNOR/EEQ. 2006-11-28 05:57:20 +00:00
steve a3da90aa4a Dump nand logic. 2006-11-28 05:56:41 +00:00
steve 48029ed8e5 Fix crash handling constant true conditional. 2006-11-27 02:01:07 +00:00
steve 94f07d16e3 Fix compile time eval of condition expresion to do reduction OR of vectors. 2006-11-26 07:10:30 +00:00
steve 041091cfac Fix nexus widths for direct link assign and ternary nets. 2006-11-26 06:29:16 +00:00
steve 0af4ea7cbe Better document the .scope record. 2006-11-23 23:02:36 +00:00
steve d6f98599f8 Do not intertangle modpaths due to references to input nets. 2006-11-23 22:42:48 +00:00
steve 2ac30824ac Fix spurious event from net8 that is forced. 2006-11-22 06:10:05 +00:00
steve 64b4e2fa01 Get the .event input from the signal instead of the signal input. 2006-11-22 06:09:08 +00:00
steve f5a204720d Support part writes into part select nodes. 2006-11-16 01:11:26 +00:00
steve 21522c90bc Process delay paths in second path over signals. 2006-11-10 05:44:44 +00:00
steve 34b5a31ff4 Add test_width methods for PETernary and PEString. 2006-11-10 04:54:26 +00:00
steve c339dc4bbc Remove last bits of relax_width methods, and use test_width
to calculate the width of an r-value expression that may
 contain unsized numbers.
2006-11-04 06:19:24 +00:00
steve ed5d3188b3 Fix padding of constant eval of NetESelect. 2006-11-04 06:16:27 +00:00
steve 8e379bd634 Handle dup of pad as well as normal select. 2006-11-04 06:10:13 +00:00
steve 841378426f Updates for Cygwin portability (pr1585922) 2006-10-30 22:45:36 +00:00
steve 2302693201 Expression widths with unsized literals are pseudo-infinite width. 2006-10-30 05:44:49 +00:00
steve 2a8b960b06 More detailed internal error message. 2006-10-15 03:25:57 +00:00
steve 0e102a94b2 Fix rendering of signed numbers in real expressions. 2006-10-10 23:54:28 +00:00
steve 168b3f2743 Fix packaging of man directories. 2006-10-09 18:56:17 +00:00
steve 0d71b1cc18 Prepare for 20061009 snapshot. 2006-10-09 18:31:56 +00:00
steve ec23bb0367 Remove dead code. 2006-10-05 01:37:34 +00:00
steve 26e2e85ffa Handle non-constant delays on indexed non-blocking assignments. 2006-10-05 01:23:53 +00:00
steve 4af28e2b77 no-specify turns of specparam elaboration. 2006-10-03 15:33:49 +00:00
steve 69cd007a71 Support real valued specify delays, properly scaled. 2006-10-03 05:06:00 +00:00
steve cbe1a6a3ca Save dep_path because arg space is overrun. 2006-10-02 18:16:18 +00:00
steve 1a0d48c346 Fix handling of dep path in new argument passing method. 2006-10-02 18:15:47 +00:00
steve 549f226c6e Modpath is input to net, draw .modpath to account. 2006-10-01 23:51:15 +00:00
steve e1f712356f Allow rosync events to create new rosync events. 2006-09-29 16:55:04 +00:00
steve 6593b603ad Modpath delay chooses correct delay for edge. 2006-09-29 03:57:01 +00:00
steve 852d10500d Man files go into /usr/share/man. 2006-09-29 01:32:17 +00:00
steve 44ca0fe798 rwsync callback fixes from Ben Staveley (with modifications.) 2006-09-29 01:24:34 +00:00
steve 35ce5f3e2a Improved mingw.txt instructions. 2006-09-28 23:45:20 +00:00
steve d6be82f748 Support selective control of specify and xtypes features. 2006-09-28 04:35:18 +00:00
steve 7e3ea2ffe8 Allow specparams as constants in expressions. 2006-09-28 00:29:49 +00:00
steve b658a3b41f Missing PSpec.cc file. 2006-09-26 19:48:40 +00:00
steve d3ceae7ee0 Accept .cpp source. 2006-09-26 18:54:42 +00:00
steve 0edb5a7547 Basic support for specify timing. 2006-09-23 04:57:19 +00:00
steve ceb6bf4afd Correct return code for vpi_put_userdata. 2006-09-22 22:33:00 +00:00
steve 0e2c6544b9 Proper error message when logic array pi count is bad. 2006-09-22 22:14:27 +00:00
steve b4893dc16f Configure scripts in general need canonical host. 2006-09-22 22:13:07 +00:00
steve f49039a3d6 Missing declaration for Windows. 2006-09-22 15:15:27 +00:00
steve 3617f0346e Bring ivl.def up to date. 2006-09-20 22:31:57 +00:00
steve f20191e6f5 tgt-verilog is not buildable for now. 2006-09-20 22:31:45 +00:00
steve 182734fd4d Remove dead code. 2006-09-20 22:31:23 +00:00
steve 431eee16e4 Do not pass -D__ICARUS__ to ivlpp. 2006-09-20 22:30:52 +00:00
steve 92cb1d4e2d Use elab_and_eval for bit select expressions. 2006-09-19 23:00:15 +00:00
steve 6f34dfc8e5 Scanf formats for character and string. 2006-08-12 04:16:07 +00:00
steve 2c7e96caec scanf support for real values. 2006-08-12 03:38:12 +00:00
steve 54c7ef72cb Snapshot 20060809 2006-08-10 01:23:29 +00:00
steve 50800fd3a1 Add support for real valued modulus. 2006-08-09 05:19:08 +00:00
steve fc0695beb6 Handle 64bit delay constants. 2006-08-08 05:11:37 +00:00
steve 00891db0d2 Fix typo in initialize of new event_time cell. 2006-08-06 18:17:00 +00:00
steve 898b0e0365 Support release of a for/linked reg. 2006-08-04 04:37:37 +00:00
steve 382c4d74fd Add the scanf functions. 2006-08-03 05:06:04 +00:00
steve 5bcf083662 Better comments for vpi_fopen function. 2006-08-03 05:05:31 +00:00
steve 1bd530c144 Fix infinite loop padding binary string to result. 2006-08-03 05:05:06 +00:00
steve 82a85131a8 Use compiletf to check arguments. 2006-08-03 05:02:46 +00:00
steve 49b65e86fe Add support for power in constant expressions. 2006-07-31 03:50:17 +00:00
steve 06d6ac4b33 Fix/implement signed right shift. 2006-07-30 02:51:35 +00:00
steve 2037650080 Pass depfiles through temp defines file. 2006-07-26 00:11:40 +00:00
steve 61f3a84557 Pass defines and includes through temp file. 2006-07-26 00:02:48 +00:00
steve ed70db84ce Handle real valued literals in net contexts. 2006-07-08 21:48:46 +00:00
steve 5348ac14a5 Delay object supports real valued delays. 2006-07-08 21:48:00 +00:00
steve aab6fefd8a Fix context determined with of constants. 2006-07-07 04:06:37 +00:00
steve 1b8e2a17c7 Change the Copyright tag to License. 2006-06-24 05:21:07 +00:00
steve 33a391cb71 Sign extend operands of signed addition. 2006-06-20 05:06:47 +00:00
steve bcc08112aa Snapshot 20060618 2006-06-18 23:56:23 +00:00
steve 80f30be9d0 Add support for system functions in continuous assignments. 2006-06-18 04:15:50 +00:00
steve 71faebd6df Make elaborate_expr methods aware of the width that the context
requires of it. In the process, fix sizing of the width of unary
 minus is context determined sizes.
2006-06-02 04:48:49 +00:00
steve 53ae1f29c9 Fix broken subtraction of small constants. 2006-06-01 03:54:51 +00:00
steve 857b3e15b6 Fix handling of ternary-to-bufif0 constant propagation. 2006-05-24 04:32:57 +00:00
steve 019d61f633 Get self-determined unary - width right. 2006-05-19 04:44:55 +00:00
steve d37b6599f4 eval_const is not strict. 2006-05-19 04:07:24 +00:00
steve 68e52ce6b7 Synchronous primitives only follow edges. 2006-05-18 05:13:45 +00:00
steve 4c885f65e1 Error message if concat expression cannot evaluate. 2006-05-17 16:49:30 +00:00
steve f0e114d59f Lexor os never interactive. 2006-05-17 04:15:12 +00:00
steve aaaa042f73 Add port list format for task arguments. 2006-05-11 03:26:57 +00:00
steve 044da54b41 Be more stubborn about widths. 2006-05-02 04:29:42 +00:00
steve a8b86ea3bb More explicit datatype setup. 2006-05-01 20:47:58 +00:00
steve e98aad1e9b Cleaner rule for parse.h and parse.cc 2006-05-01 20:47:29 +00:00
steve 1ef91f800f Forgot to invert nand output. 2006-05-01 20:47:03 +00:00
steve a19efe181b Install stub target. 2006-05-01 18:48:24 +00:00
steve 81bfbd1549 Reduce steps to make logic output. 2006-05-01 18:44:08 +00:00
steve dc2898cc73 fix net type of multiply output. 2006-05-01 05:40:21 +00:00
steve 0c9fb766b6 Get the data type of part select results right. 2006-04-30 05:17:48 +00:00
steve 10f8c66f4a Dump *all* the reduction operator gates. 2006-04-30 05:16:53 +00:00
steve 56f70ec702 Include math.h with lround implementation. 2006-04-28 15:44:37 +00:00
steve 949054e000 lround takes double, not float. 2006-04-28 15:40:30 +00:00
steve 47b72c3b74 Handle padding of MUX net results. 2006-04-28 05:09:51 +00:00
steve a2c036d5ab Allow concatenations as arguments to inout ports. 2006-04-28 04:28:35 +00:00
steve 0d17e57656 Dump indexes of ident expressions 2006-04-28 04:19:31 +00:00
steve fd94268315 Detect missing lround function. 2006-04-27 05:04:59 +00:00
steve 36039e13ec schedule takes relative, not absolute, time. 2006-04-27 04:38:00 +00:00
steve a702f99c04 Dump function type as string. 2006-04-27 04:26:38 +00:00
steve 4493e3f928 Chop down assign r-values that elaborate too wide. 2006-04-26 04:43:50 +00:00
steve 3727052000 Include bit value in assertion message. 2006-04-26 04:39:23 +00:00
steve 39ff233cf1 Detect the presence of stdint.h 2006-04-25 22:41:10 +00:00
steve 58118bddc5 Warning when file is inadequate for requested range. 2006-04-25 05:00:12 +00:00
steve c2ff3d501c Fix support for indexed part select in continuous assign l-values. 2006-04-24 05:15:07 +00:00
steve 46d86ad276 Get tail counts right in nested concatenations. 2006-04-22 04:27:36 +00:00
steve 4dd1308eb0 Parse specify ifnone statements. 2006-04-17 04:35:49 +00:00
steve a978bb1e14 Cleanup lval part select handling. 2006-04-16 00:54:04 +00:00
steve 707af782b3 Fix part selects in l-values. 2006-04-16 00:15:43 +00:00
steve fc5cf55400 Use elab_and_eval to evaluate genvar expressions. 2006-04-12 05:05:03 +00:00
steve 6a74a090f0 Configure for stub. 2006-04-10 03:07:07 +00:00
steve c448b75f2c fpga target is not installed. 2006-04-10 03:05:54 +00:00
steve aed885ecc5 Add support for generate loops w/ wires and gates. 2006-04-10 02:40:18 +00:00
steve d365c144a8 Snapshot 20060409 2006-04-10 00:54:42 +00:00
steve f001d0001a Add support for generate loops w/ wires and gates. 2006-04-10 00:37:42 +00:00
steve decfbff2b1 Clean up index expression error message. 2006-04-10 00:32:14 +00:00
steve 3e45f4302b Be more accepting of the protect directive. 2006-03-30 05:44:36 +00:00
steve 77a0d7f4db task/function ports can have types. 2006-03-30 05:22:34 +00:00
steve e8efa6df53 Fix instance arrays indexed by overridden parameters. 2006-03-30 01:49:07 +00:00
steve 276f2d0032 Accept attributes in front of module instantiations. 2006-03-25 02:42:58 +00:00
steve 13a660b591 Get rid of excess PESTring:: prefix within class declaration. 2006-03-25 02:36:26 +00:00
steve f4a44df2cc Support more parameter syntax. 2006-03-18 22:53:38 +00:00
steve 5b3ba8c306 Properly handle signedness in compare. 2006-03-18 22:52:27 +00:00
steve 8defa4bcd0 Syntax for carrying sign with parameter. 2006-03-18 22:51:10 +00:00
steve dabdcf0fc9 const/non-const clash. 2006-03-15 19:15:34 +00:00
steve 8ff70410ab Handle multiple part/bi devices connected together. 2006-03-15 05:52:20 +00:00
steve 6f46d12e07 Add support for logic parameters. 2006-03-08 05:29:42 +00:00
steve 5f5a6b5396 Cleanup vpi_const to use vec4 values. 2006-03-06 05:43:15 +00:00
steve 1b911ad87a Add support for memory value change callbacks. 2006-03-05 05:45:58 +00:00
steve b0b614ae0e Some trivial log message improvements. 2006-02-22 03:08:53 +00:00
steve 9c16c34422 Put strings for reg objects. 2006-02-21 05:31:54 +00:00
steve 170e57d662 Callbacks for named event triggers. 2006-02-21 04:57:26 +00:00
steve 065f342278 Remove dead code. 2006-02-21 03:19:03 +00:00
steve a721586acb Get vpiVectorVal from memory words. 2006-02-21 02:56:49 +00:00
steve 50ad415c0d Support string values for memory words. 2006-02-21 02:39:27 +00:00
steve 4ba2afbbe1 Use g++ linker if there are C++ source files. 2006-02-21 02:38:44 +00:00
steve d3f89e0d4f Clean up makefiles to remove unsupported targets. 2006-02-15 18:42:42 +00:00
steve 457cf15b3b Snapshot 20060215 2006-02-15 18:00:33 +00:00
steve d0de678d57 real-to-integer conversions round, not truncate. 2006-02-02 05:48:45 +00:00
steve fa6e4a69a6 Parse more cases of (*). 2006-02-02 05:21:45 +00:00
steve d434dd7296 Allow part selects of memory words in l-values. 2006-02-02 02:43:57 +00:00
steve 3158e2caa1 Snapshot 20060124 2006-01-25 02:16:11 +00:00
steve e1ce72e245 Support wide divide nodes. 2006-01-03 06:19:31 +00:00
steve 368c27c9e4 Handle complex net node delays. 2006-01-03 05:22:14 +00:00
steve a4116efd57 Fix the return type of a synthesized divide. 2006-01-03 05:15:33 +00:00
steve 58f182a159 Node delays can be more general expressions in structural contexts. 2006-01-02 05:33:19 +00:00
steve b7861fa6e8 Require explicit delay node from source. 2006-01-02 05:32:06 +00:00
steve 1721799050 Document binary expression use. 2005-12-22 15:44:29 +00:00
steve df226c5d13 pad_to_width handles signed expressions. 2005-12-22 15:43:47 +00:00
steve e9bf00dff6 Pad part selects 2005-12-22 15:42:22 +00:00
steve c071cc1bbe More detailed check of binary expressions. 2005-12-22 15:38:33 +00:00
steve 101b373293 Allow constant concat expressions. 2005-12-07 04:04:23 +00:00
steve 5cf64dfa70 Include stdint.h if it is present. 2005-12-07 03:43:30 +00:00
steve 1021e5acc8 Fixes for stubborn compilers. 2005-12-05 21:21:18 +00:00
steve 4f7e7a2296 Some systems donot have stding.h? 2005-12-05 21:20:55 +00:00
steve 0c73f209de Be more careful with double types. 2005-12-05 21:19:55 +00:00
steve 0873c52474 vpi_signal supports vvp_fun_signal_vec types. 2005-11-30 00:42:14 +00:00
steve 64d46630e0 Snapshot 20051127 2005-11-27 17:53:28 +00:00
steve 8ed504b064 Fix for stubborn compiler. 2005-11-27 17:01:56 +00:00
steve 6161904bf8 Fix type safety warning from gcc. 2005-11-27 16:47:14 +00:00
steve 908955c72c Handle bit select of parameter with ranges. 2005-11-27 05:56:20 +00:00
steve bab70ccbed Handle indexed l-value to force. 2005-11-26 17:23:17 +00:00
steve 2b8fd28a95 Force instruction that can be indexed. 2005-11-26 17:16:05 +00:00
steve 0e044d6684 More precise about r-value width of constants. 2005-11-26 00:35:42 +00:00
steve 7efa6be236 stop/continue messages go through MCD for logging. 2005-11-25 18:35:38 +00:00
steve 35951510c5 Put vec8 and vec4 nets into seperate net classes. 2005-11-25 17:55:26 +00:00
steve 3f108f08ed Dump IVL_ST_DELAYX statements. 2005-11-20 15:58:53 +00:00
steve 244844c067 Document the IVL_ST_DELAY statements. 2005-11-20 15:58:25 +00:00
steve b416ae047b Fix compile warning. 2005-11-14 22:11:52 +00:00
steve c02b3b8ac6 Reorganize signal part select handling, and add support for
indexed part selects.

 Expand expression constant propagation to eliminate extra
 sums in certain cases.
2005-11-10 13:28:11 +00:00
steve bebcc05aab Handle very wide % and / operations using expanded vector2 support. 2005-11-10 13:27:16 +00:00
steve 8d49abf967 Document the MUXZ functor. 2005-11-10 13:25:31 +00:00
steve c87223170b Prepare for snapshot 20051012 2005-10-13 03:04:06 +00:00
steve 8e2898e51a Fix compile of net/real aliases. 2005-10-12 17:28:07 +00:00
steve 9c8c541f5d MUX nodes get inputs from nets, not from net inputs,
Detect and draw alias nodes to reduce net size and
 handle force confusion.
2005-10-12 17:26:17 +00:00
steve 3cdf655c79 force l-values do not support bit/part select. 2005-10-12 17:26:01 +00:00
steve 560c5a2584 Add alias nodes. 2005-10-12 17:23:15 +00:00
steve c75f0a930e Remove the $ from signal labels. They do not help. 2005-10-11 18:54:10 +00:00
steve bb3f3c1f46 Remove obsolete vvp_memory_label function. 2005-10-11 18:30:50 +00:00
steve 07f345da4d Logical or/and return VT_LOGIC type. 2005-10-11 16:15:52 +00:00
steve fb22bcc96b Remove dead dram_input_from_net and lpm_inputs_a_b 2005-10-10 04:16:13 +00:00
steve 2842a65fd1 Make sure the new size sticks in resize method. 2005-10-04 04:41:07 +00:00
steve a652719876 Add support for indexed select attached to parameters. 2005-10-04 04:09:25 +00:00
steve 16dc3ab4d4 Error message for invalid for-loop index variable. 2005-09-27 04:51:37 +00:00
steve cf85c19f7b Simplify NexusSet set handling. 2005-09-25 23:40:11 +00:00
steve 01a6dd61ca Support put_value of string values. 2005-09-21 01:04:59 +00:00
steve bf8b085159 Clean up compiler warnings. 2005-09-20 18:34:01 +00:00
steve ee22550047 Lazy processing of vvp_fun_part functor. 2005-09-20 00:51:53 +00:00
steve 2b07c7a685 Prevent some excess scheduling of logic propagation events. 2005-09-19 22:47:28 +00:00
steve be73be8c98 Spelling patches from Larry. 2005-09-19 21:45:35 +00:00
steve e2a1b90b12 Use lazy eval of BUF/NOT/OR/XOR gates. 2005-09-19 21:45:09 +00:00
steve d22d88923d Fix warnings about uninitialized variables. 2005-09-19 20:18:20 +00:00
steve 2729d6cd2e Include vvp_config.h instead of config.h 2005-09-19 20:17:59 +00:00
steve 21af0dbe3f Fix data type of parameters to logic. 2005-09-19 15:21:09 +00:00
steve c4d8ab8509 Improve loading of part selects when easy. 2005-09-17 04:01:32 +00:00
steve 988a0a7048 Add the load/v.p instruction. 2005-09-17 04:01:01 +00:00
steve 672aa61ae7 More robust use of precalculated expressions, and
Separate lookaside for written variables that can
 also be reused.
2005-09-17 01:01:00 +00:00
steve 7235706923 Make sure div, mod and mult nodes have line number info. 2005-09-15 23:04:09 +00:00
steve a256613fa6 Fix bug configuring NetModulo pins. 2005-09-15 22:54:47 +00:00
steve 5ec7dde52f Use iostream instead of stdio. 2005-09-15 22:54:04 +00:00
steve 19a1ae8d4f Preserve precalculated expressions when possible. 2005-09-15 02:50:13 +00:00
steve 14d79a655e Better reuse of IVL_EX_SELECT expressions. 2005-09-15 02:49:47 +00:00
steve 293976bacc Spelling fixes. 2005-09-15 02:30:09 +00:00
steve 4dfdc147c5 fit type elaboration of logical not. 2005-09-14 15:15:44 +00:00
steve c946f27d9b Add b0 and b1 edges to parser. 2005-09-14 15:01:07 +00:00
steve 9fd16575d9 Support bool expressions and compares handle them optimally. 2005-09-14 02:53:13 +00:00
steve b9c0b8aa79 Add an extensions.txt file. 2005-09-14 02:51:13 +00:00
steve 65584e6dde Add word integer compares. 2005-09-14 02:50:07 +00:00
steve c39976fbf1 Generate code to handle real valued muxes. 2005-09-01 04:11:37 +00:00
steve 4902c222fb Check operand types for compatibility. 2005-09-01 04:10:47 +00:00
steve ad761069c7 Support MUXR functors. 2005-09-01 04:08:47 +00:00
steve b69f59f2ec Handle memory references is continuous assignments. 2005-08-31 05:07:31 +00:00
steve 3ff2488d4f Clean up a few overflowed shifts. 2005-08-30 00:49:42 +00:00
steve efd7825964 minor correction to address check in of_MOV1XZ 2005-08-30 00:49:21 +00:00
steve 70f146924a Safe handling of C left shift. 2005-08-29 04:46:52 +00:00
steve 7c19eb51e7 Minor cleanup. 2005-08-29 04:46:13 +00:00
steve 6f839aa5df Eliminate int to vvp_bit4_t casts. 2005-08-29 02:38:50 +00:00
steve dac11c2468 Handle synthesis of fully packed case statements. 2005-08-27 04:32:08 +00:00
steve 5cf2ce6499 Fix bit destination address in of_AND 2005-08-27 03:28:57 +00:00
steve 73453996a9 Be more cautios about accessing out-of-range bits. 2005-08-27 03:28:16 +00:00
steve bc489a7761 Bring threads into the vvp_vector4_t structure. 2005-08-27 02:34:42 +00:00
steve 4a8be3db9c Implement bi-directional part selects. 2005-08-06 17:58:16 +00:00
steve 8232b621f1 Fix parse errors related to pr766. 2005-07-27 14:54:51 +00:00
steve 4cbffc6b77 bufif enable is LOGIC. 2005-07-15 19:22:52 +00:00
steve 9a16e030b5 Match data type of PV select input/output. 2005-07-15 04:13:25 +00:00
steve d353ddb660 Get output type correct for binary mux (ternary) expression. 2005-07-15 00:42:02 +00:00
steve bc9f286954 More debug information. 2005-07-15 00:41:09 +00:00
steve fde4ff72f6 Display as version 0.9.devel 2005-07-14 23:38:43 +00:00
steve a8d49921ee gcc4 compile errors. 2005-07-14 23:34:18 +00:00
steve 9cae53988a Dump function call expression node. 2005-07-14 16:15:13 +00:00
steve 559a1fd359 Remove the .word statement. 2005-07-13 04:58:29 +00:00
steve 5bfdd52391 Handle functions with real values. 2005-07-13 04:52:31 +00:00
steve b094ccc3f7 Functions get type from their output signal. 2005-07-13 04:51:36 +00:00
steve b9799cf6ec Remove NetVariable and ivl_variable_t structures. 2005-07-11 16:56:50 +00:00
steve 75ad90534b Generalize signals to carry types. 2005-07-07 16:22:49 +00:00
steve 3ac79c294a Implement real valued signals and arith nodes. 2005-07-06 04:29:25 +00:00
steve e7f3340513 Remove reference to SystemVerilog. 2005-06-28 04:25:55 +00:00
steve 60b9121c6c Make vector2 multiply more portable. 2005-06-27 21:13:14 +00:00
steve e3f300f4c2 AND functor explicitly knows its width. 2005-06-26 21:08:38 +00:00
steve 1c6be44724 More verbose debugging of part select width errors. 2005-06-26 21:08:11 +00:00
steve 6bf7556d65 Check width of part select based on direction. 2005-06-26 18:09:24 +00:00
steve c46f978dbb Fix uninitialzied attr pointers for UDP devices. 2005-06-26 18:08:46 +00:00
steve 9cac88330b AND gates propogate through scheduler, not directly. 2005-06-26 18:06:29 +00:00
steve de1dd2f2b3 Make bit masks of vector4_t 64bit aware. 2005-06-26 01:57:22 +00:00
steve 6c8e1f7834 inline the vvp_send_vec4_pv function. 2005-06-24 02:16:42 +00:00
steve b58705b829 Inline more simple stuff, and more vector4_t by const reference for performance. 2005-06-22 18:30:12 +00:00
steve 7091915b73 Reduce vvp_vector4 copies by using const references. 2005-06-22 00:04:48 +00:00
steve 5513974b78 Optimize vvp_scalar_t handling, and fun_buf Z handling. 2005-06-21 22:48:23 +00:00
steve ad78af2f91 Inline some commonly called vvp_vector4_t methods. 2005-06-20 01:28:14 +00:00
steve 1b30bac9f3 Optimize the LOAD_VEC implementation. 2005-06-19 18:42:00 +00:00
steve 66a579dd67 Handle signed display of unsigned signals. 2005-06-18 15:55:21 +00:00
steve 094dd7e4de threads member for waitable_hook_s needs initailizing. 2005-06-17 23:47:02 +00:00
steve 3b91db96cd Support set of IntVal to memory words. 2005-06-17 05:13:07 +00:00
steve 657ac8168e Debug messages. 2005-06-17 05:06:47 +00:00
steve a79fee39e9 Watch out for signed constants in magnitude compare. 2005-06-17 05:05:53 +00:00
steve 4cc421b3b7 Make functors know their own width. 2005-06-17 03:46:52 +00:00
steve 290c604c62 Fix bit offsets when processing lval concatenation. 2005-06-15 01:33:33 +00:00
steve 466ab5c2c7 Resolv do not propogate inputs that do not change. 2005-06-15 00:47:15 +00:00
steve 4ba195282d gcc3/4 compile errors. 2005-06-14 19:13:43 +00:00
steve cd14ee77ae Add the assign_v0_d instruction. 2005-06-14 01:44:09 +00:00
steve 21c7abf090 Accomodate fussy compilers. 2005-06-14 00:42:06 +00:00
steve 4413dd3c81 Fix compile errors. 2005-06-13 23:22:37 +00:00
steve 73f3589ea6 use NetPartSelect to shrink part from high bits. 2005-06-13 23:22:14 +00:00
steve 9278dad244 Make synthesized padding vector-aware. 2005-06-13 22:26:03 +00:00
steve a0dce80eba Document ivl_logic_delay function. 2005-06-13 22:25:37 +00:00
steve af5f713c0f Dump delays for logic devices. 2005-06-13 22:20:38 +00:00
steve 80cac983c6 More unified vec4 to hex string functions. 2005-06-13 00:54:04 +00:00
steve f5ba93eeb6 Remove unused ft_MOS truth tables. 2005-06-12 21:56:16 +00:00
steve 668781788b Support resistive mos devices. 2005-06-12 15:13:37 +00:00
steve 86729f52ca Remove functor classes, no longer needed. 2005-06-12 01:42:20 +00:00
steve fb8ddbbfde Remove useless references to functor.h 2005-06-12 01:25:27 +00:00
steve 2736859d8f Remove useless references to functor.h 2005-06-12 01:10:26 +00:00
steve a59f3b1fa6 Implement nmos and pmos devices. 2005-06-12 00:44:49 +00:00
steve dd4f765b06 Remove unneeded references to functor.h 2005-06-11 18:11:18 +00:00
steve f465bca305 UD delays use delay node. 2005-06-11 16:21:08 +00:00
steve cb967c10fe Handle all edge types of a synchronous UDP. 2005-06-11 02:04:48 +00:00
steve 3607fb584d Support UDP initial values. 2005-06-09 05:04:45 +00:00
steve 77792dcc2f Support sequential UDP devices. 2005-06-09 04:12:30 +00:00
steve 2f7ec71a78 Support %force/link 2005-06-02 16:03:47 +00:00
steve 42433f4df9 Add support for notif0/1 gates.
Make delay nodes support inertial delay.
 Add the %force/link instruction.
2005-06-02 16:02:11 +00:00
steve aa2e178667 Handle event/or with specific, efficient nodes. 2005-05-25 05:44:51 +00:00
steve 015d280c6a Handle assignments to part-select l-values. 2005-05-24 02:31:18 +00:00
steve 739a1839ed Do sign extension of structuran nets. 2005-05-24 01:44:27 +00:00
steve b6fd4f610b Add a sign-extension node. 2005-05-24 01:43:27 +00:00
steve 06e08dbdf0 Make sure comparison widths match. 2005-05-19 03:51:38 +00:00
steve 28168e0f57 Fixup structural GT comparators. 2005-05-18 03:46:01 +00:00
steve 7796c8bcfb Parameters cannot have their width changed. 2005-05-17 20:56:55 +00:00
steve 82be4ab189 Detect bit selects that need special handling. 2005-05-17 20:55:42 +00:00
steve 3a8e2e688d Clean up definition of vvp_vector4_t insertion into ostream. 2005-05-17 20:54:56 +00:00
steve 037ab9efe9 Document real behavior of set/v instruction. 2005-05-17 20:54:00 +00:00
steve d6a89a40cf Clean up instruction type reverences to bits. 2005-05-17 20:51:06 +00:00
steve 3bd09d1470 synthesis of Logic and shifts using vector gates. 2005-05-15 04:47:00 +00:00
steve d0ade1d082 Debug text. 2005-05-15 04:45:50 +00:00
steve fcb02ee9c2 Disable obsolete logic constant fixup code. 2005-05-15 04:44:30 +00:00
steve 870395e627 Move functor delays to vvp_delay_fun object. 2005-05-14 19:43:23 +00:00
steve c701fb615b Give buffers support for simple delays. 2005-05-13 05:13:12 +00:00
steve adbe734b6c Some debug messages. 2005-05-13 05:12:39 +00:00
steve c34e44dad0 Make sig-eq-constant optimization more effective. 2005-05-10 05:10:40 +00:00
steve 5a2dd3393f Skip assign if index is invalid. 2005-05-09 00:38:12 +00:00
steve ed78c5b677 Force part base out of bounds if index is invalid. 2005-05-09 00:36:58 +00:00
steve 7dd0d255a6 Add support for variable part select. 2005-05-08 23:40:14 +00:00
steve 48aa0f0075 Better handle assignment to bit/part select. 2005-05-07 03:16:31 +00:00
steve 5277124c76 Implement non-blocking part assign. 2005-05-07 03:15:42 +00:00
steve f6da64e2ec ostream insert for vvp_vector4_t objects. 2005-05-07 03:14:50 +00:00
steve 06816e79fe Clarify internal delays for assignments. 2005-05-07 03:14:00 +00:00
steve a1d899112a Include delay expressions for assignments in dump. 2005-05-07 03:13:30 +00:00
steve d548c9a5f8 Handle synthesis of concatenation expressions. 2005-05-06 00:25:13 +00:00
steve 2894cdefc7 Add cassign/link instruction. 2005-05-01 22:05:21 +00:00
steve df271c9fa3 Link signals that are source of procedural continuous assign. 2005-05-01 22:04:12 +00:00
steve 99aff5f10b Remove dead functor code. 2005-04-28 04:59:53 +00:00
steve e9bf021f6c vvp_fun_signal eliminates duplicate propagations. 2005-04-25 04:42:17 +00:00
steve aed8474944 Reimplement basic asynchronous processes. 2005-04-25 01:35:58 +00:00
steve af7e196518 synthesis of add and unary get vector widths right. 2005-04-25 01:30:31 +00:00
steve 365cfedd55 Update DFF support to new data flow. 2005-04-24 23:44:01 +00:00
steve f884652c19 Add DFF nodes. 2005-04-24 20:07:25 +00:00
steve 6244dc1194 Make logic aware of strength. 2005-04-13 06:35:11 +00:00
steve a3f696cd06 Add vvp driver functor for logic outputs,
Add ostream output operators for debugging.
2005-04-13 06:34:20 +00:00
steve 061fdf5a0d scalars with 0-drivers are hiZ by definition. 2005-04-09 06:00:58 +00:00
steve fe91ebe77c Default behavior for recv_vec8 methods. 2005-04-09 05:30:38 +00:00
steve e8a6835d36 Make clear that memory addresses are cannonical. 2005-04-08 04:52:31 +00:00
steve 800e2c6a17 All memory addresses are signed. 2005-04-08 04:51:16 +00:00
steve 29fa9e7321 Don not give to make_add express an unwanted width. 2005-04-08 04:50:31 +00:00
steve 65c7ec00e7 Rework NetRamDq and IVL_LPM_RAM nodes. 2005-04-06 05:29:08 +00:00
steve d62661257a Generate the right coes for unconnected UDP port. 2005-04-04 05:29:53 +00:00
steve c5cf77dc7e Support row level wildcards. 2005-04-04 05:13:59 +00:00
steve 20d3a8508e Remove dead fvectors class. 2005-04-03 06:13:34 +00:00
steve f16b69c1e5 Remove dead fvectors class. 2005-04-03 06:13:34 +00:00
steve 573e07225d Rework the vvp_delay_t class. 2005-04-03 05:45:51 +00:00
steve 236ff2b278 Clean up handle of UDPs. 2005-04-01 06:04:30 +00:00
steve b7ef2fcb0a Reimplement combinational UDPs. 2005-04-01 06:02:45 +00:00
steve becda0e26c popen must be matched by pclose. 2005-03-22 15:53:48 +00:00
steve d8a456bd67 The indexed set can write a vector, not just a bit. 2005-03-22 05:18:34 +00:00
steve 8184dfaed8 Handle wide operands to logical AND. 2005-03-19 06:59:53 +00:00
steve ca488dff4e Handle LPM shifts. 2005-03-19 06:23:49 +00:00
steve 23925b636e vvp.conf files are generated. 2005-03-18 02:57:23 +00:00
steve 53da6e9a33 Add support for LPM_UFUNC user defined functions. 2005-03-18 02:56:03 +00:00
steve 0f914bf35a UPdate elabrate continuous assighn of string to net. 2005-03-13 01:26:48 +00:00
steve f556452403 Handle function/task port vectors. 2005-03-12 23:45:33 +00:00
steve ab1ca54df2 Update support for LPM_MOD. 2005-03-12 06:43:35 +00:00
steve bae8507c90 Implement .arith/mod. 2005-03-12 06:42:28 +00:00
steve 313502f360 Implement VPI access to signal strengths,
Fix resolution of ambiguous drive pairs,
 Fix spelling of scalar.
2005-03-12 04:27:42 +00:00
steve 1c5b4881d7 Handle case inequality in netlists. 2005-03-09 05:52:03 +00:00
steve 53af2949b4 Generate code for new form of memory ports. 2005-03-09 04:53:40 +00:00
steve 789c95b1c1 reimplement memory ports. 2005-03-09 04:52:40 +00:00
steve 72240c460e Remove dead code from scheduler. 2005-03-06 17:25:03 +00:00
steve 8e135a1020 Non blocking assign to memory words. 2005-03-06 17:07:48 +00:00
steve 0fb1fd36ee Handle memory words in l-value concatenations. 2005-03-05 05:47:42 +00:00
steve e7c2e06260 Check that lead.mv vector width matches word. 2005-03-05 05:45:18 +00:00
steve 73997f813c Get read width of unitialized memory words right. 2005-03-05 05:44:32 +00:00
steve 75af32bd3c Get base address from word ranges that VPI user passed. 2005-03-05 05:43:03 +00:00
steve 4ccbb4f0b2 Get rval width right for arguments into task calls. 2005-03-05 05:38:33 +00:00
steve 85286cc086 Rearrange how memories are supported as vvp_vector4 arrays. 2005-03-03 04:33:10 +00:00
steve 04604188df Clock compression fix from Tony. 2005-02-19 16:45:01 +00:00
steve f7dc4307bd Fix duplicate delete from pr1073. 2005-02-19 16:44:38 +00:00
steve 257e1f9516 Support shifts and divide. 2005-02-19 02:43:38 +00:00
steve 5fe5d9184d Handle signed divide. 2005-02-19 02:41:23 +00:00
steve 589eb1d315 Implement .arith/div. 2005-02-19 01:32:52 +00:00
steve 2fcaac4060 Support constant part select writes to l-values, and large part select reads from signals. 2005-02-15 07:12:55 +00:00
steve 4051f7d986 Handle bitmux lvalues for constant r-values. 2005-02-14 05:00:11 +00:00
steve 02d0719529 l-value input may be a vector. 2005-02-14 04:58:50 +00:00
steve aaf35ab1a9 Handle bit selects in l-values to assignments. 2005-02-14 01:51:39 +00:00
steve c5e7e2ec0a Signals may receive part vectors from %set/x0
instructions. Re-implement the %set/x0 to do
 just that. Remove the useless %set/x0/x instruction.
2005-02-14 01:50:23 +00:00
steve ff067bb959 tri0 and tri1 resolvers must replace HiZ with 0/1 after resolution. 2005-02-13 05:26:30 +00:00
steve 1d7235b4f1 Replace supply nets with wires connected to pullup/down supply devices. 2005-02-13 01:15:07 +00:00
steve 97e0723bd1 Cleanup unused truth tables. 2005-02-12 23:05:25 +00:00
steve d4eb4d38bc Implement a-b muxes as vector devices 2005-02-12 22:54:29 +00:00
steve d00e3fc9a9 Check IVL_LPM_MUX configuration. 2005-02-12 22:53:41 +00:00
steve 9ec00e1288 Fix copyright notice. 2005-02-12 22:52:45 +00:00
steve 85d9ebded8 Implement the vvp_fun_muxz functor. 2005-02-12 22:50:52 +00:00
steve d74177634c Restructure NetMux devices to pass vectors.
Generate NetMux devices from ternary expressions,
 Reduce NetMux devices to bufif when appropriate.
2005-02-12 06:25:40 +00:00
steve eca4f4fa97 Draw C4 and C8 constants to account for strength. 2005-02-12 06:25:15 +00:00
steve 6b7b82758a Check nexus widths of IVL_LO_ nodes. 2005-02-12 06:17:43 +00:00
steve 355ead0002 Add debug dumps for vectors, and fix vvp_scaler_t make from BIT4_X values. 2005-02-12 06:13:22 +00:00
steve 4fce321900 Support C8 constants. 2005-02-12 03:27:18 +00:00
steve 2e6d2f8e98 Support scheduling vvp_vector8_t objects. 2005-02-12 03:26:14 +00:00
steve 55b5bf9d39 distinguish between single port namy instances, and single instances many sub-ports. 2005-02-10 04:56:58 +00:00
steve 1979fca239 Get the C4 width right for undriven nexa. 2005-02-10 04:55:45 +00:00
steve a0583ef124 Simplify vvp_scaler strength representation. 2005-02-10 04:54:41 +00:00
steve ee5bb5fcaf Add the NetRepeat node, and code generator support. 2005-02-08 00:12:36 +00:00
steve ca1bbc79a3 Add .repeat functor and BIFIF functors. 2005-02-07 22:42:42 +00:00
steve e74127e1fc Support .concat with arbitrary input counts. 2005-02-04 05:13:57 +00:00
steve b48abb2148 Add wide .arith/mult, and vvp_vector2_t vectors. 2005-02-04 05:13:02 +00:00
steve 97f83ffbe3 laborate reduction gates into LPM_RED_ nodes. 2005-02-03 04:56:20 +00:00
steve 018014368b Add support for reduction logic gates. 2005-02-03 04:55:13 +00:00
steve 20be0351ae Elaborate unary subtract and NOT in netlist
contexts, and concatenation too.
2005-01-30 05:20:38 +00:00
steve 68a788221e Support LPM_SUB 2005-01-30 05:09:04 +00:00
steve 84b3e8e2dc Get .arith/sub working. 2005-01-30 05:06:49 +00:00
steve e6cdd32c19 Clarify width argument to NetNet constructor. 2005-01-30 01:43:48 +00:00
steve c23a35a033 Debug messages for PGAssign elaboration. 2005-01-30 01:42:05 +00:00
steve 609b6a7baa Netlist boolean expressions generate gate vectors. 2005-01-29 18:46:18 +00:00
steve 0609c5f18c Use scheduler to initialize constant functor inputs. 2005-01-29 17:53:25 +00:00
steve d51503ffd8 move AND to buitin instead of table. 2005-01-29 17:52:06 +00:00
steve 7625a6c3e7 Check width of constant attached to nexus. 2005-01-29 16:47:52 +00:00
steve 695718d691 Clarify width of nexus. 2005-01-29 16:47:20 +00:00
steve e04fb5c083 Elaborate parameter reference to desired width without concats. 2005-01-29 16:46:22 +00:00
steve 07f64bc603 Support interactive mode even without readline. 2005-01-29 06:29:17 +00:00
steve bf3679b7d4 Add the -s flag to start up interactive. 2005-01-29 06:28:19 +00:00
steve ade5bdcafe Integrate pr1072 fix from v0_8-branch. 2005-01-29 00:37:06 +00:00
steve 7250337941 Integrate fixes from 0.8 branch. 2005-01-28 19:39:03 +00:00
steve 99ace10774 Simplified NetMult and IVL_LPM_MULT. 2005-01-28 05:39:33 +00:00
steve 6be34bba4d Special handling of constant shift 0. 2005-01-28 05:37:48 +00:00
steve a5b431ad20 Show the lpm_mult device. 2005-01-28 05:36:18 +00:00
steve a121e703f3 Add vector4 implementation of .arith/mult. 2005-01-28 05:34:25 +00:00
steve dfb7c7ba6f Remove the NetEBitSel and combine all bit/part select
behavior into the NetESelect node and IVL_EX_SELECT
 ivl_target expression type.
2005-01-24 05:28:30 +00:00
steve edeb9d8eca Part selects are done in the compiler, not here. 2005-01-24 05:08:02 +00:00
steve 14f557e6f4 Check widths of ternary expressions. 2005-01-24 05:05:25 +00:00
steve 25de448d34 Remove obsolete NetSubnet class. 2005-01-22 18:16:00 +00:00
steve cb4e0d4724 stub dump signed flags of magnitude compare. 2005-01-22 17:36:59 +00:00
steve 6a23f16860 .cmp/x supports signed magnitude compare. 2005-01-22 17:36:15 +00:00
steve a4710f375e LPM_CMP_NE/EQ are vectored devices. 2005-01-22 16:22:13 +00:00
steve 6c5e840617 Implement vectored CMP_EQ and NE 2005-01-22 16:21:11 +00:00
steve e28636776a Change case compare from logic to an LPM node. 2005-01-22 01:06:55 +00:00
steve b86fdd6bbc Implement the .cmp/eeq LPM node. 2005-01-22 01:06:20 +00:00
steve 1d1dda5a5d Implement the %load/x instruction. 2005-01-22 00:58:22 +00:00
steve 3222031970 Add missing concat.cc to cvs 2005-01-22 00:01:09 +00:00
steve bf6a5d0f50 Implement LPM_COMPARE nodes as two-input vector functors. 2005-01-16 04:20:32 +00:00
steve 1c3668ea7f Reimplement comparators as vvp_vector4_t nodes. 2005-01-16 04:19:08 +00:00
steve ead2481793 Fix elaboration of == compared to constants. 2005-01-13 00:23:10 +00:00
steve fcaaec0464 More robust input code generation for LPM_ADD. 2005-01-12 05:31:50 +00:00
steve 4d139b58aa Properly pad vector widths in pgassign. 2005-01-12 03:17:36 +00:00
steve 8c18c9152d More complete drawing of concat inputs. 2005-01-12 03:16:35 +00:00
steve 399dfe5c44 Handle concatenations with up to 16 inputs. 2005-01-10 01:42:59 +00:00
steve 9e94afe399 Use PartSelect/PV and VP to handle part selects through ports. 2005-01-09 20:16:00 +00:00
steve 6c711ee4d8 Merge $fopen robustness fix from 0.8 2005-01-09 20:12:22 +00:00
steve 9735b0e8b3 Add the .part/pv node and related functionality. 2005-01-09 20:11:15 +00:00
steve d5c33420ab vvp_fun_signal propagates vvp_vector8_t vectors when appropriate. 2005-01-01 02:12:34 +00:00
steve 34a14b983b Implement .resolv functors, and stub signals recv_vec8 method. 2004-12-31 06:00:06 +00:00
steve d1e2538aba No need to draw BUF or BUFZ tables. 2004-12-31 05:57:25 +00:00
steve 8bfc75d1ee Add specific BUFZ functor. 2004-12-31 05:56:36 +00:00
steve b1b93f860c Fix uninitialized fun pointer for resolver nodes. 2004-12-31 05:54:46 +00:00
steve 8f2d679c8a Unify elaboration of l-values for all proceedural assignments,
including assing, cassign and force.

 Generate NetConcat devices for gate outputs that feed into a
 vector results. Use this to hande gate arrays. Also let gate
 arrays handle vectors of gates when the outputs allow for it.
2004-12-29 23:55:43 +00:00
steve 83423c978b Generate code for the .concat functors, from NetConcat objects.
Generate C<> constants of correct widths for functor arguments.
2004-12-29 23:52:09 +00:00
steve 1674d692b7 Add the part concatenation node (.concat).
Add a vvp_event_anyedge class to handle the special
 case of .event statements of edge type. This also
 frees the posedge/negedge types to handle all 4 inputs.

 Implement table functor recv_vec4 method to receive
 and process vectors.
2004-12-29 23:45:13 +00:00
steve 7166598ed0 Fix missing output propagation of part node. 2004-12-29 23:44:39 +00:00
steve 5eb25e44e1 Add ivl_event_scope, and better document ivl_event_X methods. 2004-12-18 18:56:18 +00:00
steve 59566158c4 Better detail on event trigger and wait statements. 2004-12-18 18:55:08 +00:00
steve e11ac0b1d8 Use %set/v to trigger events. 2004-12-18 18:53:26 +00:00
steve 8939467ac5 Rework named events and event/or. 2004-12-18 18:52:44 +00:00
steve 26d97558c4 Replace single release with release/net and release/reg. 2004-12-17 04:47:47 +00:00
steve 59bac26f4f Implement release functionality. 2004-12-17 04:46:40 +00:00
steve 78dda42493 Add the force/v instruction. 2004-12-15 17:17:42 +00:00
steve 36f36bd2ac Add basic force/release capabilities. 2004-12-15 17:16:08 +00:00
steve 0193daa436 Display the release statement details. 2004-12-15 17:11:13 +00:00
steve 4444079409 Fixup force statement elaboration. 2004-12-15 17:10:40 +00:00
steve 3947d7dd33 Force r-value padded to width. 2004-12-15 17:09:11 +00:00
steve 7973dad9f5 Arrange statement dumping in new source files. 2004-12-12 18:15:06 +00:00
steve d19e76a193 Fix r-value width of continuous assign. 2004-12-12 18:13:39 +00:00
steve ffedf32476 cassign and deassign handle concatenated l-values. 2004-12-11 05:43:30 +00:00
steve 527ddea811 Add stub conf files to cvs. 2004-12-11 04:22:35 +00:00
steve 65e9b6be12 Rework of internals to carry vectors through nexus instead
of single bits. Make the ivl, tgt-vvp and vvp initial changes
 down this path.
2004-12-11 02:31:25 +00:00
steve 6854660e18 v0.8 is its own directory. 2004-10-13 22:08:10 +00:00
steve 6818d996ea Version stamps for 0.8 2004-10-13 22:01:34 +00:00
steve 4907776eaa Prepare for snapshot 20041004 2004-10-04 18:46:26 +00:00
steve 51dd41f81a Fix excessive error message. 2004-10-04 03:09:38 +00:00
steve e4ae832153 Clean up spurious trailing white space. 2004-10-04 01:10:51 +00:00
steve b3a3428b9a Clean up bin32 files. 2004-10-04 01:09:07 +00:00
steve 2abdcfcaa4 Error message to match assertion. 2004-10-04 00:25:46 +00:00
steve 526b87cae3 Remove inaccurate comment. 2004-10-04 00:25:18 +00:00
steve 9383b165a4 MTI functions only user Mersene Twister 2004-10-04 00:14:08 +00:00
steve e827f8f8c1 Cleanup and factoring of autoconf. 2004-09-27 22:34:10 +00:00
steve 965d928430 More carefull about eliding bufzs that carry strength. 2004-09-25 21:04:25 +00:00
steve 96936456da Add a debug_elaborate flag 2004-09-25 01:58:44 +00:00
steve 94647be1f0 Some commentary on ivl_logic_pin. 2004-09-25 01:58:12 +00:00
steve e45230061e Dump tri0 and tri1 nets. 2004-09-25 01:57:33 +00:00
steve 180bfc5e72 Detect and prevent implicit declaration of hierarchical names. 2004-09-24 04:25:19 +00:00
steve 6d40326a2f Fix LPM GE to match LPM GT behavior. 2004-09-22 16:44:07 +00:00
steve 0a630b60dd Fix make check for pristine sources. 2004-09-18 01:59:44 +00:00
steve 1e4ffc292d Snapshot 20040915 2004-09-16 03:24:28 +00:00
steve a579114ae2 net_output handles l-value concatenations. 2004-09-16 03:17:33 +00:00
steve 8dfe16f6d2 Parse attributes attached to reg declarations. 2004-09-14 18:24:56 +00:00
steve d1dac0017d Fix the evaluation of constant ternary expressions. 2004-09-10 23:51:42 +00:00
steve 5e627c9adc Compile cleanup of C code. 2004-09-10 23:13:05 +00:00
steve 98ba641e67 Remove bad casts. 2004-09-10 00:15:45 +00:00
steve a70dd79cd8 Missing stdio.h header for warnings. 2004-09-10 00:15:17 +00:00
steve a8ee786036 Relaxed width constraint on pad_expression output. 2004-09-10 00:14:31 +00:00
steve d16e8f7c94 Macros can have null values. 2004-09-06 03:01:48 +00:00
steve 4148a2a44c Better type safety. 2004-09-05 21:29:07 +00:00
steve 5f38591676 Better type safety. 2004-09-05 21:19:51 +00:00
steve c10e572091 Support degenerat wait statements. 2004-09-05 21:07:26 +00:00
steve 1ab8879100 Fix syntax for $period to allow min:Ltyp:max expressions. 2004-09-05 21:01:51 +00:00
steve 2d498363d7 Handle instance array of port-less modules. 2004-09-05 18:09:47 +00:00
steve 15059bbfdc More acurate note about system functions. 2004-09-05 17:54:22 +00:00
steve 9de786fc44 Add support for module instance arrays. 2004-09-05 17:44:41 +00:00
steve 62cffe16f4 PR1026: assignment statements can have sensitivities in the l-values. 2004-09-04 04:24:15 +00:00
steve d3eb53e6b1 Better rule for install of system.sft. 2004-08-30 17:42:53 +00:00
steve b631e6e704 Snapshot 20040828 2004-08-28 16:50:26 +00:00
steve ba3790dc2b .net range values can be signed. 2004-08-28 16:26:41 +00:00
steve f02f5be3cc Fix use of system tasks in AT_STAR statements. 2004-08-28 16:23:05 +00:00
steve 7f67afe9d5 Add support for $unsigned. 2004-08-28 15:42:11 +00:00
steve d76ad25778 Do not change reg to wire in NetAssign_ unless synthesizing. 2004-08-28 15:08:31 +00:00
steve 21ba781604 More detailed error message about bad variable. 2004-08-28 14:59:44 +00:00
steve 95c8115fc7 Add support for localparam ranges. 2004-08-26 04:02:03 +00:00
steve 49366d1334 Add the $is_signed function. 2004-08-26 03:51:51 +00:00
steve e2b94947f5 Fix read count passed to fgets. 2004-08-24 16:16:23 +00:00
steve efe05a77cb nex_output for NetPDelay statements. 2004-06-30 15:32:18 +00:00
steve 8bf434754f Propagate source line number in synthetic delay statements. 2004-06-30 15:32:02 +00:00
steve 491df9c327 Watch out for real compared to constant. Handle as real. 2004-06-30 03:07:32 +00:00
steve fca2e64808 Dump variable type of system function. 2004-06-30 03:05:04 +00:00
steve 6cd7c1a650 Some explination of vpi_func arguments. 2004-06-30 03:00:36 +00:00
steve 3dbc07f34d Implement signed divide and signed right shift in nets. 2004-06-30 02:16:26 +00:00
steve 57b8ca191f Add signed LPM divide. 2004-06-30 02:15:57 +00:00
steve 9ee0210cac Code cleanup from Larry. 2004-06-24 15:22:23 +00:00
steve 69cfdbdc54 Fix broken calcuation of NE for constant. 2004-06-22 18:41:48 +00:00
steve 76c0fe459c Only pad the width of vector r-values. 2004-06-20 15:59:06 +00:00
steve 9ba1177a4d Generate signed modulus if appropriate. 2004-06-19 16:17:37 +00:00
steve 51fd249d8a Watch type of mak bit matches masked value. 2004-06-19 16:17:02 +00:00
steve 050ec6f325 Add signed modulus operator. 2004-06-19 15:52:53 +00:00
steve 03d7448550 compare-to-constant uses sig len, not val len. 2004-06-18 16:38:22 +00:00
steve b3529d8593 Help system function signedness survive elaboration. 2004-06-17 16:06:18 +00:00
steve 112368c7de Add a .sft file for the system functions. 2004-06-17 14:47:22 +00:00
steve d1f0a0b0d7 Save seed in static variable, in case user doesnt pass it. 2004-06-17 14:44:01 +00:00
steve b043445c80 Generate .cmp/eq nodes instead of sea of gates. 2004-06-16 23:33:42 +00:00
steve fd371a3958 Handle equality compare to constants specially. 2004-06-16 23:32:58 +00:00
steve 35619771dd Add structural equality compare nodes. 2004-06-16 16:33:25 +00:00
steve bdc6cb8723 Dump NE LPM device. 2004-06-16 16:22:04 +00:00
steve 2d63705093 Connect rsif of multiply to DataB. 2004-06-16 16:21:34 +00:00
steve b108167441 rdynamic for openbsd. 2004-06-13 16:27:17 +00:00
steve 9949040285 Add support for the default_nettype directive. 2004-06-13 04:56:53 +00:00
steve e8e0cd7cab Support / and % in synthesized contexts. 2004-06-12 15:00:02 +00:00
steve f2d4966634 Fix transcription error scaling c in uniform range. 2004-06-10 02:14:42 +00:00
steve 50bf2095df Move Mersenne Twister to $mti_random, and make
the standard $random standard. Also, add $dist_poisson.
2004-06-09 22:14:10 +00:00
steve 2003c5a21e Fix build order of vvp and vpi. 2004-06-09 22:13:43 +00:00
steve bfd393c91c Remove extra sub-make of vpi directory. 2004-06-09 22:13:14 +00:00
steve 37ae777111 Update to snapshot 20040606 2004-06-06 14:51:58 +00:00
steve dd69872266 Special case for unary - of real literal. 2004-06-04 23:34:15 +00:00
steve fbfc796647 Add unary minus as operator supported by verireal. 2004-06-04 23:33:51 +00:00
steve 8d3102388b Pick sign bit from the right place in the exponent number. 2004-06-04 23:26:34 +00:00
steve ba309e60bb Fix synthesis method for logical and/or 2004-06-01 01:04:57 +00:00
steve 5472b27e1f Rewire/generalize parsing an elaboration of
function return values to allow for better
 speed and more type support.
2004-05-31 23:34:36 +00:00
steve e7fa56981a More identifier lists use perm_strings. 2004-05-25 19:21:06 +00:00
steve 55ba131997 Handle wait with constant-false expression. 2004-05-25 03:42:58 +00:00
steve 559f73c135 Attach line numbers to wait statements. 2004-05-25 03:42:44 +00:00
steve b97f9448e0 Add support for the -I compiler flag. 2004-05-20 00:40:34 +00:00
steve a7ae8adf9b Support delayed/non-blocking assignment to reals and others. 2004-05-19 03:26:24 +00:00
steve 896f1b0de1 Generate code for nb assign to reals. 2004-05-19 03:25:42 +00:00
steve ca55cadc6c Add ivl_target support for non-blocking assign of real. 2004-05-19 03:18:40 +00:00
steve 324ba713e5 Handle explicit set of unsigned long width. For -m32 2004-05-18 18:45:11 +00:00
steve 69ebd0c49e Allow vpiParamter as a string type. 2004-05-18 18:43:38 +00:00
steve d60112d58b Handle null string as a single nul character. 2004-05-18 18:43:15 +00:00
steve 5807d6912e Protect ident pragma. 2004-03-17 17:07:12 +00:00
steve ec0e35b940 Treat cygwin like Unix for build purposes. 2004-03-17 17:06:44 +00:00
steve c8d67b904a Only include DEBUG_SYNTH2 if __FUNCTION__ defined. 2004-03-15 18:40:12 +00:00
steve c55adddb69 Assume struct initializers are GCC specific. 2004-03-15 18:35:37 +00:00
steve 8e63f56caf standard conpliant stdio.h. 2004-03-13 05:12:36 +00:00
steve 9e223b9696 Clean up rules for iverilog-vpi vs driver-vpi. 2004-03-11 06:13:58 +00:00
steve dd7472d125 Mingw needs -liberty, but Cygwin cannot tolerate it. 2004-03-11 06:06:59 +00:00
steve 0ef1ecab5e Verbose details for sft parsing. 2004-03-11 06:02:58 +00:00
steve 28719e8584 Add support for system function table files. 2004-03-10 04:51:24 +00:00
steve a0ed5e9e29 Separate out the lookup_sys_func table, for eventual
support for function type tables.

 Remove ipal compile flags.
2004-03-09 04:29:42 +00:00
steve 20b7a23bde Define function types. 2004-03-09 04:29:26 +00:00
steve 33783385d2 Get vpiModule of signals. 2004-03-09 03:11:02 +00:00
steve 914746f6f3 Minor spelling fixes. 2004-03-08 02:33:49 +00:00
steve c6453a0854 primitive ports can bind bi name. 2004-03-08 00:47:44 +00:00
steve 413932e406 Verilog2001 new style port declartions for primitives. 2004-03-08 00:10:29 +00:00
steve 9531920685 MOre thorough use of elab_and_eval function. 2004-03-07 20:04:10 +00:00
steve 4456937274 Snapshot 20040220 2004-02-21 01:39:58 +00:00
steve efef8fba85 Add load command to interactive stop.
Support decimal constants passed interactive to system tasks.
2004-02-21 00:44:34 +00:00
steve 177b6ffb6a Addtrbute keys are perm_strings. 2004-02-20 18:53:33 +00:00
steve 1295058e5d parameter keys are per_strings. 2004-02-20 06:22:56 +00:00
steve b5b02269f1 unused variable warning. 2004-02-20 03:20:04 +00:00
steve 60adfb845d Do not strip leading spaces, or expect them either. 2004-02-20 01:53:02 +00:00
steve a4c5ff0bd3 vpiStringVal does not include leading nulls. 2004-02-20 01:52:25 +00:00
steve 72f9dc5094 Add the $fgets function. 2004-02-19 21:33:13 +00:00
steve 65f09337f6 Add sysfunctype to calltf structure. 2004-02-19 21:32:46 +00:00
steve 8d2858c555 vpiStringVal writes need to set all the bits of a reg. 2004-02-19 21:31:59 +00:00
steve 89acc41437 LPM, logic and Variables have perm_string names. 2004-02-19 07:06:57 +00:00
steve 536068bdfb Memory and Event names use perm_string. 2004-02-19 06:57:10 +00:00
steve 2d7380c03b PRototypes match the standard. 2004-02-18 17:52:00 +00:00
steve 27af95d402 Use perm_strings for named langiage items. 2004-02-18 17:11:54 +00:00
steve 17c891bc9c Fix type mismatches of various VPI functions. 2004-02-18 02:51:59 +00:00
steve 38ec4b7851 Support unsigned divide of huge numbers. 2004-02-17 06:52:55 +00:00
steve 6f9ebb1e60 Add the $dumpflush function 2004-02-15 20:46:01 +00:00
steve 0fd5a79760 Cleanup of warnings. 2004-02-15 18:03:30 +00:00
steve 4288f3c6d0 Better error checking of primitive tables. 2004-02-15 17:48:28 +00:00
steve d64295ed65 primitives support reg output name syntax. 2004-02-15 17:48:16 +00:00
steve 2f8a40b159 Fix evaluation of compare to constant expression. 2004-02-15 04:23:48 +00:00
steve 081a6a4088 Cleanup configure detection of win32. 2004-02-15 03:17:36 +00:00
steve c971448760 dumpfile selects file at compiletf time. 2004-02-15 03:17:15 +00:00
steve c275ef9482 Report elaboration errors without crashing. 2004-02-15 00:19:29 +00:00
steve 8188c4c690 Makefile cleanup. 2004-02-10 19:25:00 +00:00
steve d482e341ae Fix direction of Q/D signals of FD devices. 2004-02-10 16:39:33 +00:00
steve f2b9b8946f Snapshot 20040209 2004-02-09 21:29:05 +00:00
steve fa4a873628 Add support for lxt2 break size 2004-02-06 18:23:30 +00:00
steve a436bfc711 Include from current directory. 2004-01-28 23:54:10 +00:00
steve c2ab27541f Make sure I get ivl_target.h from this source. 2004-01-26 23:31:57 +00:00
steve 5160021b48 Make sure file64 support is on cc -D flags. 2004-01-26 21:52:46 +00:00
steve f349449a49 Honor default format of numbers. 2004-01-23 23:40:44 +00:00
steve de7f87853d Generate error when missing concatenation operands. 2004-01-21 04:57:40 +00:00
steve 6a02613fca Get rid of useless warning. 2004-01-21 04:35:03 +00:00
steve 3bb408faf2 Add support for initialization assign in port list declaration of reg. 2004-01-21 03:37:12 +00:00
steve 4987970af4 Give the vip directory its own configure and vpi_config.h 2004-01-21 01:22:51 +00:00
steve d98720af4d Isolate configure from containing config.h 2004-01-20 21:00:47 +00:00
steve 793493d3ff Snapshot 20040118 2004-01-19 00:10:58 +00:00
steve 36785997cb Improve the gperf warning message. 2004-01-18 23:34:00 +00:00
steve 923a3ea537 The is_combinational function really need not recurse. 2004-01-18 23:26:54 +00:00
steve 8aca824c0f Further unify the configure.in scripts. 2004-01-15 20:52:32 +00:00
steve e6b25a4e20 Get the NEED_LU define right for win32. 2004-01-15 06:05:20 +00:00
steve d98b7ffb2e Remove duplicate NetEvProbe objects in nodangle. 2004-01-15 06:04:19 +00:00
steve e617e4a98c Handle wide expressions in wait condition. 2004-01-13 03:42:49 +00:00
steve 1970e41041 Get value for vpoiConstType correct. 2004-01-13 02:55:50 +00:00
steve e331b182a7 Synthesis debug messages. 2003-12-20 00:59:31 +00:00
steve 11b0cc5bf3 More thorough check that NetEvWait is asynchronous. 2003-12-20 00:33:39 +00:00
steve 5b0c7be6b7 Add ANSI style parameter port declarations. 2003-12-19 05:15:04 +00:00
steve 59ac435c71 Fix various unsigned compare warnings. 2003-12-19 01:27:10 +00:00
steve 57c3e86084 Debug dumps for synth2. 2003-12-17 16:52:39 +00:00
steve f0e0377a20 Add acc_set_scope function. 2003-12-17 15:45:07 +00:00
steve ae3198b505 Install target gets vvp.conf that is built, not from srcdir. 2003-12-12 19:58:40 +00:00
steve d4525ddc16 Some systems dlsym requires leading _ or not on whim. 2003-12-12 05:43:08 +00:00
steve 19e8a92729 Fix make check to support -tconf configuration method. 2003-12-12 04:36:48 +00:00
steve 1bd1d287e4 tfname can be constant. 2003-12-07 20:06:24 +00:00
steve 4c8c14ceec Ducument lxt2 access. 2003-12-07 20:05:56 +00:00
steve df968687e4 Generate VVP_EXECUTABLE flag in conf files. 2003-12-07 19:28:43 +00:00
steve 973b4d9bcb Pre-gcc3 compile error. 2003-12-03 04:27:10 +00:00
steve 2a60768ffe Snapshot 20031202 2003-12-03 03:31:39 +00:00
steve e56b77a43f Add support for wait on list of named events. 2003-12-03 02:46:23 +00:00
steve 9967bfcbfd Handle erroneous event lists. 2003-12-03 01:54:07 +00:00
steve 2c4358c9ff Propagate named event outputs, if any. 2003-11-26 01:47:18 +00:00
steve be0b42f210 Warning about sprintf. 2003-11-26 01:37:38 +00:00
steve cf33bedc2d Properly initialize vpi_module_list with system. 2003-11-26 01:37:14 +00:00
steve 0b538ceed6 The _pli_types.h header file is generated, not copied from srcdir. 2003-11-26 01:36:55 +00:00
steve 8d4c3a8620 Document the IVERILOG_ICONFIG variable. 2003-11-26 01:36:25 +00:00
steve 700d51ff8a Fix reset race in test bench. 2003-11-25 18:35:31 +00:00
steve cceb2bd2c5 Remove the iverilog.conf file. 2003-11-18 06:31:45 +00:00
steve 12033d7bd4 Move the DLL= flag to target config files. 2003-11-13 05:55:33 +00:00
steve c96b0402be Package the new conf files. 2003-11-13 05:54:03 +00:00
steve 5068e3ea15 Pass flags through the temporary config file. 2003-11-13 04:09:49 +00:00
steve 435f06bd21 ivl -F and -t flags are onpassed throught the -C file. 2003-11-13 03:10:37 +00:00
steve 534a656be8 devices need show_cmp_gt 2003-11-12 03:20:14 +00:00
steve d10da2121f Clean up manual definitions of PLI_UINT64_FMT. 2003-11-12 02:38:44 +00:00
steve 43f28b53a3 Design::get_flag returns const char* instead of string. 2003-11-10 20:59:03 +00:00
steve 995cd449c5 Include config.h 2003-11-10 20:19:32 +00:00
steve 7fa531c5db Missing config.h. 2003-11-10 20:18:02 +00:00
steve df08760ef8 Simply MSVC compatibility patch. 2003-11-10 20:15:33 +00:00
steve a7c773262e missing include of config.h 2003-11-10 20:11:01 +00:00
steve f58b124101 Fix return value warnings. 2003-11-10 19:44:30 +00:00
steve 8eccb7b9a1 Remove redundant scope tokens. 2003-11-10 19:39:20 +00:00
steve bc0ead2842 Spelling fixes in comments. 2003-11-08 20:06:21 +00:00
steve 80570c7c78 some header files in the build directory, as well as srcdir. 2003-11-08 19:30:15 +00:00
steve ed831e7c32 Move come configure tests to aclocal.m4 2003-11-08 19:27:50 +00:00
steve 074dcc934a Do not remove constants accessible to VPI. 2003-11-08 17:53:34 +00:00
steve 9db45e398e Make sure makefile picks up include paths. 2003-11-08 16:20:33 +00:00
steve 4f40eb0a00 Implement basic fflush. 2003-11-07 19:40:05 +00:00
steve 1dfbe0f7f2 Fix conditional compilation of readline history. 2003-11-07 05:58:02 +00:00
steve c5f7e7837b Start the vvp target config files. 2003-11-01 04:22:50 +00:00
steve faf33458fd Accept functors in the config file. 2003-11-01 04:22:30 +00:00
steve 0607970eca Add support for a target static config file. 2003-11-01 04:21:57 +00:00
steve c4e069e505 Handle adders that use Cout for the top bit. 2003-10-31 03:45:50 +00:00
steve 7fd669fcc0 NetEUReduce has its own dup_expr method. 2003-10-31 02:47:11 +00:00
steve fad43d78b0 Donot elide FF that has set or clr connections. 2003-10-31 02:40:06 +00:00
steve 5aadc310f7 Call register for fileio functions. 2003-10-30 04:52:54 +00:00
steve 930e5137ac Catch real variables in net expressions. 2003-10-30 04:31:34 +00:00
steve 02ec36806c Rearrange fileio functions, and add ungetc. 2003-10-30 03:43:19 +00:00
steve e88c3a20a2 Details on the vpi_get_file function. 2003-10-30 03:42:51 +00:00
steve 5ff3bcc7fb Add the PLU_UINT64_FMT string for formatting output. 2003-10-29 03:28:27 +00:00
steve 4236b8a95e Portably handle time format of VCD prints. 2003-10-29 03:23:12 +00:00
steve 89fca07dc8 Add the iverilog-fpga man page. 2003-10-27 06:12:47 +00:00
steve 4eae8426a9 More flexible width handling for synthesized add. 2003-10-27 06:04:21 +00:00
steve 1b8034818c Emit constants for LPM device. 2003-10-27 02:18:27 +00:00
steve a503e2d91f Handle special case of FF with enable and constant data. 2003-10-27 02:18:04 +00:00
steve 65ae69843b Improve -V messages, 2003-10-26 22:43:42 +00:00
steve 1c99c629b1 Support constant evaluation of binary ^ operator. 2003-10-26 04:54:56 +00:00
steve edaa7df6d2 Output of While is output of while substatement. 2003-10-26 04:51:38 +00:00
steve 847448139c Case with empty statements has no inputs. 2003-10-26 04:50:46 +00:00
steve ee172bdccf Attach line number information to for loop parts. 2003-10-26 04:49:51 +00:00
steve 5496a38499 vvp_signal_label does not return a unique string. 2003-10-25 02:07:57 +00:00
steve 8dab4c6b53 memory index need not be self determined width. 2003-10-20 01:44:28 +00:00
steve 3e44a7121d Include net objects in list display. 2003-10-15 02:17:39 +00:00
steve d4f3349fe0 Syntax error on 32bit systems. 2003-10-14 18:05:18 +00:00
steve f2382e209a Document the --install-dir and -m32 flags. 2003-10-14 00:40:06 +00:00
steve 123e4c7f65 Report the configure vpi install directory. 2003-10-14 00:31:31 +00:00
steve bb8785962f Support 32bit compile on AMD64 systems. 2003-10-13 20:57:34 +00:00
steve dba4f44598 AMD64 has both 32bit and 64bit cadpli. 2003-10-10 03:34:38 +00:00
steve ec9361ae22 Install rules for vvp32/system.vpi 2003-10-10 03:34:15 +00:00
steve 906e7d9946 Install rules for vvp32/system.vpi 2003-10-10 03:31:40 +00:00
steve 9628b4d047 Snapshot 20031009 2003-10-10 03:04:07 +00:00
steve 46bb8c68fa Some PLI1 stubs. 2003-10-10 02:57:45 +00:00
steve a461a76bd5 Emit .event inputs before the .event statement. 2003-10-09 23:45:03 +00:00
steve 368e2211e3 More detailed AMD64 build instructions. 2003-10-09 23:41:50 +00:00
steve e9f1fd012c Put parameter name in NetEConstParam, not scope. 2003-10-09 16:52:52 +00:00
steve c34d5699ee Ignore the bin32 directory. 2003-10-09 16:27:41 +00:00
steve 468ffa4bd0 Default vpidir1 must match that of parent configure. 2003-10-09 05:58:06 +00:00
steve e49856fad4 Add vvp32 support for cadpli. 2003-10-09 01:07:20 +00:00
steve ee81485582 Support 32bit development library for libveriuser. 2003-10-09 00:37:58 +00:00
steve 8cf7b62933 Support both 32bit and 64bit system.vpi on AMD64. 2003-10-08 23:17:39 +00:00
steve cf1affff32 TIME_FMT does not include the % character. 2003-10-08 23:14:29 +00:00
steve 9a232d545d Completely support vvp32 when enabled. 2003-10-08 23:09:09 +00:00
steve fc44f44879 Check for libhistory library. 2003-10-06 21:42:25 +00:00
steve ddba06904c Put libveriuser into a single .o file. 2003-10-06 21:27:05 +00:00
steve a89f39f166 Include sys_priv.h instead of priv.h 2003-10-06 21:26:27 +00:00
steve 9b821c0dbd Segregate 64bit and 32bit files on AMD64. 2003-10-06 18:58:32 +00:00
steve 52b756a6fa Configure control for the vpi subdirectory. 2003-10-02 21:30:40 +00:00
steve 7ef45769a7 Use configured TIME_FMT in vcd dump printf. 2003-10-02 21:30:06 +00:00
steve fff6e88245 Include timerec_to_time64 implementation. 2003-10-02 21:16:11 +00:00
steve 01d22e2005 Put libraries in libdir64. 2003-10-02 19:33:44 +00:00
steve 691d31faac Add PLI_UINT64 to _pli_types.h. 2003-10-02 18:36:34 +00:00
steve 3190eda414 Slightly more efficient unary minus. 2003-10-01 17:44:20 +00:00
steve 40daff0aed dumpers must be aware of 64bit time. 2003-09-30 01:33:39 +00:00
steve f7b3c720af Add PLI_UINT64 to _pli_types.h. 2003-09-30 01:33:13 +00:00
steve 2f4ec5a473 Warnings cleanup. 2003-09-26 21:25:58 +00:00
steve d21351405a turn partial off when maximally compressing. 2003-09-26 21:23:08 +00:00
steve 1cb589fee0 Assure ternary arguments are wide enough. 2003-09-26 02:44:27 +00:00
steve 8c30d217d5 Delete pform when done with it. 2003-09-26 02:17:14 +00:00
steve 86e9489530 Fix check.conf to match new driver. 2003-09-26 02:16:52 +00:00
steve 07ece95383 Slight performance tweaks of scheduler. 2003-09-26 02:15:15 +00:00
steve 2ed433b8c1 Detect missing endif markers. 2003-09-26 02:08:31 +00:00
steve 39b2928ad8 Summary list of missing modules. 2003-09-25 00:25:14 +00:00
steve becae2cecd Snapshot 20030924 2003-09-24 21:02:55 +00:00
steve 2231b830db Standard udp scheduling behavior. 2003-09-24 20:46:48 +00:00
steve 2970b3c39b Clear expression lookaside after true cause of ternary. 2003-09-24 20:46:20 +00:00
steve daa85f2479 Pass -m flag from driver via iconfig file. 2003-09-23 05:57:15 +00:00
steve 2f8181f40a Cleanup lxt2 writer with version from gtkwave 1.2.31 2003-09-23 03:40:59 +00:00
steve d1f0bcf620 Catch unsized expressions in continuous assigns. 2003-09-23 03:31:28 +00:00
steve 933f4483b1 Pass more ivl arguments through the iconfig file. 2003-09-22 01:12:08 +00:00
steve 2e6cfd8c0d min:typ:max delay values in specify statements. 2003-09-21 21:16:05 +00:00
steve 6abe797963 Evaluate nb-assign r-values using elab_and_eval. 2003-09-20 06:08:53 +00:00
steve 94a71fdee8 Evaluate gate array index constants using elab_and_eval. 2003-09-20 06:00:37 +00:00
steve 39df56fdcf Evaluate memory index constants using elab_and_eval. 2003-09-20 05:24:00 +00:00
steve 1f0c274e82 Obsolete find_symbol and find_event from the Design class. 2003-09-20 01:05:35 +00:00
steve 693794552c Remove find_memory method from Design class. 2003-09-19 03:50:12 +00:00
steve da7956a797 Fix name search in elab_lval. 2003-09-19 03:30:04 +00:00
steve 1de5e6c848 Support --includedir to configure. 2003-09-17 04:30:33 +00:00
steve ed792c5321 Internal documentation of UDP devices. 2003-09-17 03:39:55 +00:00
steve 31c0a9dcd1 Missing case warnings. 2003-09-13 01:30:07 +00:00
steve 1c51e1787c Disable lxt when zlib is missing. 2003-09-13 01:28:47 +00:00
steve 178847fc53 Spelling fixes. 2003-09-13 01:01:51 +00:00
steve 7e7735ce21 Get rid of spurious parse.cc.h error messages. 2003-09-13 00:59:56 +00:00
steve 537fe0547a Comments. 2003-09-13 00:59:02 +00:00
steve 9093877073 Export ivl_signal lsb/msb. 2003-09-13 00:58:24 +00:00
steve 6927e0fa1f Add lxt2 support for partial mode. 2003-09-10 17:53:42 +00:00
steve 2418ab9063 Reimpelement scheduler to divide nonblocking assign queue out. 2003-09-09 00:56:45 +00:00
steve 2df976b4c6 Cross compile patches. 2003-09-05 18:04:16 +00:00
steve c4c03e6be3 20030904 snapshot. 2003-09-04 20:29:59 +00:00
steve cee34f8a8a Support time0 resolution of combinational threads. 2003-09-04 20:28:05 +00:00
steve aa40930278 Tonys -12 snapshot of lxt2 support. 2003-09-04 20:27:39 +00:00
steve 59c5759fdf Add $push flag for threads. 2003-09-04 20:26:30 +00:00
steve f495c75faf Evaluate real parameter expressions that contain real parameters. 2003-09-04 01:52:50 +00:00
steve fea68f7fe7 Support synchronous set of LPM_FF devices. 2003-09-03 23:34:09 +00:00
steve 7521aa83f8 Pass FF synchronous set values to code generator. 2003-09-03 23:33:29 +00:00
steve c26df174a1 Oops, missing pin_Sset implementation. 2003-09-03 23:32:10 +00:00
steve b0230cf4d4 Support synthesis of constant downshifts. 2003-09-03 23:31:36 +00:00
steve ca0a9faa90 Only build a mux as wide as can be selected. 2003-09-03 04:29:18 +00:00
steve af806ed9c3 Add lxt2 support. 2003-09-01 04:04:03 +00:00
steve 2272843511 32bit vs 64bit handling in SUBI. 2003-09-01 04:03:38 +00:00
steve fdb5731b8b Add $recrem to specify syntax. 2003-08-31 21:14:28 +00:00
steve 7c1401a2ba Spelling patch. 2003-08-28 04:11:17 +00:00
steve 14150d6fba ifdef idents correctly. 2003-08-26 16:26:01 +00:00
steve 816aba993f iverilog-vpi support --cflags a la gtk. 2003-08-26 04:45:47 +00:00
steve 60b2e89b1b Add support for fstrobe system tasks. 2003-08-26 03:51:05 +00:00
steve 64d795c53a Preserve variable ranges all the way to the vpi. 2003-08-22 23:14:26 +00:00
steve ec07674d40 Fix Makefiles to support read-only source directory. 2003-08-22 04:27:10 +00:00
steve 0a012c5d90 Fix uninitialized sset member. 2003-08-22 04:14:33 +00:00
steve cd4b3b0f17 Snapshot 20030815. 2003-08-15 18:28:27 +00:00
steve 3dc73aa292 vpiIntVal treats x and z bits as 0. 2003-08-15 18:23:56 +00:00
steve e561819179 Add synthesis support for synchronous reset. 2003-08-15 02:23:52 +00:00
steve 855c2fe001 Clean up memory leak in setup. 2003-08-15 02:12:15 +00:00
steve bc428cfe9b Fix dangling pointer in NexusSet handling blocks. 2003-08-14 02:41:05 +00:00
steve bdd0b455bd Careful list of dependencies. 2003-08-10 17:42:33 +00:00
steve fff8278eb4 Detect asynchronous FF inputs that are expressions. 2003-08-10 17:04:23 +00:00
steve b6c3f94d52 Add async clear to LPM_FF devices. 2003-08-10 16:42:23 +00:00
steve 6b7879c0b0 Ignore autom4te.cache files. 2003-08-10 00:41:26 +00:00
steve adcafb6f24 Install man pages on Windows build. 2003-08-10 00:39:13 +00:00
steve 23d5b68153 Ignore more automake cache. 2003-08-09 04:32:33 +00:00
steve aadf39a985 De emphasize the obsolete -txnf target. 2003-08-09 04:31:44 +00:00
steve a95463ff81 Add support for IVL_LPM_MULT device. 2003-08-09 03:23:03 +00:00
steve fbe6fc315b Generate LPM_FF devices. 2003-08-09 02:40:50 +00:00
steve 63fb5ea03c Add support for OR/NOR/bufif0/bufif1. 2003-08-07 05:18:04 +00:00
steve 800e9dd76a Add arch=lpm to the documentation. 2003-08-07 05:17:34 +00:00
steve f4b8a4877f Add an LPM device type. 2003-08-07 04:04:01 +00:00
steve e312e99448 Fix error truncating bitvec in output. 2003-08-06 18:24:55 +00:00
steve c96598a429 Primitive outputs have same limitations as continuous assignment. 2003-08-05 03:01:58 +00:00
steve 38d851f04e Ignore automake files. 2003-08-03 21:16:16 +00:00
steve ddbb95870d Too many names to list. 2003-08-03 03:55:11 +00:00
steve d3d63c1b8b mcd value can come from a vpiNet. 2003-08-03 03:54:02 +00:00
steve 5e326cd90e Subtract from constant values. 2003-08-03 03:53:38 +00:00
steve 1a3a3fbcfa Fix || with true case on the right. 2003-08-01 02:12:30 +00:00
steve d6420f9e0c Fix arithmetic operators in 64bit processors. 2003-08-01 00:58:34 +00:00
steve 2d5b48ce0a Initialize allocated memory. 2003-08-01 00:58:03 +00:00
steve 66b7b36bc5 20030730 snapshot 2003-07-30 18:19:35 +00:00
steve d653a7e88d Add support for triand and trior. 2003-07-30 01:13:28 +00:00
steve d4b7c835de All the threads of a named fork go into sub-scope. 2003-07-29 05:12:10 +00:00
steve 31b1fb4ec4 Watch out for moving nexus_ptr while adding pins to nexus. 2003-07-26 04:06:58 +00:00
steve bfe31e22bf Start handling pad of expressions in code generators. 2003-07-26 03:34:42 +00:00
steve e854ecd993 Special x86_64 support. 2003-07-25 03:49:43 +00:00
steve 48b6b6f460 UPdate to snapshot 20030722. 2003-07-23 02:39:17 +00:00
steve e7ddf21233 Inline the svector<string> constructor. 2003-07-23 02:35:44 +00:00
steve c6cf7e017b Forgot to read the /x parameter for %load/x 2003-07-22 20:30:24 +00:00
steve 5e954e94fa Overflow of unsigned when calculating unsigned long value. 2003-07-21 02:39:15 +00:00
steve 4b7b32d385 vpi_mcd_vprintf can only scan the va_list once. 2003-07-21 01:20:59 +00:00
steve a378efb398 Careful to save format string to prevent overwrite. 2003-07-21 01:19:58 +00:00
steve 0cfac55d8a Update config.guess and config.sub 2003-07-20 18:18:09 +00:00
steve 008c2cf448 Needs the config.h header. 2003-07-16 00:54:07 +00:00
steve 82bfbf41ea Fix spelling of ifdef. 2003-07-15 16:17:47 +00:00
steve 4a8b9e549a Move PUdp constructor into compiled file. 2003-07-15 05:07:13 +00:00
steve cadf4cfdef Spelling fixes. 2003-07-15 03:49:22 +00:00
steve 4641966349 Obsolete the verilog.1 man page. 2003-07-15 03:48:07 +00:00
steve 6cc5dd93fe Handle line termination a la mac/windows/unix. 2003-07-15 02:41:07 +00:00
steve 5f96dc9faf Update to snapshot 20030705. 2003-07-05 20:52:47 +00:00
steve 77da147629 Fix some enumeration warnings. 2003-07-05 20:42:08 +00:00
steve 1c4552e262 PAD names are LOC strings, not simple numbers 2003-07-05 20:22:18 +00:00
steve 5b351599f0 Allow attributes on Verilog 2001 port declarations. 2003-07-04 03:57:18 +00:00
steve c2feb162f2 PAD attribute can be used to assign pins. 2003-07-04 01:08:03 +00:00
steve 7734ba99fc Generate MUXF5 based 4-input N-wide muxes. 2003-07-04 00:10:09 +00:00
steve dccd7ec7e2 Remove the vvp_cpoint_t indirect code pointer. 2003-07-03 20:03:36 +00:00
steve 272dc749da IOPAD support. 2003-07-03 17:46:33 +00:00
steve 01b858ef13 Wider thread vector limit. 2003-07-03 17:44:10 +00:00
steve 939a85054d spemm WORDS_BIGENDIAN correctly. 2003-07-03 16:29:55 +00:00
steve 004ecd08dd Elide empty begin-end in conditionals. 2003-07-02 04:19:16 +00:00
steve eb605694eb More xilinx common code. 2003-07-02 03:02:15 +00:00
steve b810556d3f Remember to set INIT on wide-or trailing luts. 2003-07-02 02:58:18 +00:00
steve 3a3e288f6f No longer export generic-edif functions. 2003-07-02 00:48:03 +00:00
steve 0ffb613229 Missing copyright notice. 2003-07-02 00:27:24 +00:00
steve 2e4276f5c5 Fix spelling of part= flag. 2003-07-02 00:26:49 +00:00
steve daad030ce6 Add xilinx support for bufif1. 2003-07-02 00:25:40 +00:00
steve 5314ec373b lut3 for 3input wide or. 2003-06-30 19:21:21 +00:00
steve 03089bdbf3 Add support for wide OR/NOR gates. 2003-06-28 04:18:47 +00:00
steve 253f3bc660 Add Xilinx support for A/B MUX devices. 2003-06-26 03:57:05 +00:00
steve 7b933eddd4 Correct handle of put to function return value. 2003-06-26 03:20:24 +00:00
steve a9595fe6ba Do not elide ports of cells. 2003-06-25 04:46:03 +00:00
steve e8a222e783 Fix mingw portability problems. 2003-06-25 04:04:19 +00:00
steve 0e797dc7bc Virtex and Virtex2 share much code. 2003-06-25 02:55:57 +00:00
steve f7162eb538 Spelling fixes. 2003-06-25 01:49:06 +00:00
steve 56b876afc4 Add -Wall to compile. 2003-06-25 01:48:39 +00:00
steve 957a464743 Virtex support for NOT gates. 2003-06-25 01:46:44 +00:00
steve 79248d0592 Add ivl_synthesis_cell support for virtex2. 2003-06-24 03:55:00 +00:00
steve 21ff80075a Various warnings fixed. 2003-06-24 01:38:02 +00:00
steve bad861dba3 Module attributes make it al the way to ivl_target. 2003-06-23 01:25:44 +00:00
steve 5cb5a19819 ivl_synthesis_cell cuts off synthesis within a module. 2003-06-23 00:14:44 +00:00
steve 996d4c76db vpi_handle diagnostic message. 2003-06-22 04:19:26 +00:00
steve 565e4f1fed gettimeprecision will null argument has specific meaning. 2003-06-21 23:40:15 +00:00
steve 61195c5daa Harmless fixup of warnings. 2003-06-21 01:21:42 +00:00
steve ccf4d4d7da Module attributes from the parser
through to elaborated form.
2003-06-20 00:53:19 +00:00
steve cc5f7a64b0 Add attributes to modules. 2003-06-19 18:54:49 +00:00
steve 71a404a546 Add arithmetic shift operators. 2003-06-18 03:55:18 +00:00
steve ae418c6a6d Account for all 64 bits in results of $time. 2003-06-18 00:54:28 +00:00
steve 2894c021e7 Better trace of PLI1 registration. 2003-06-17 22:09:45 +00:00
steve 2321df4bfc Remove short int restrictions from vvp opcodes. (part 2) 2003-06-17 21:28:59 +00:00
steve 96ca885aca Remove short int restrictions from vvp opcodes. 2003-06-17 19:17:42 +00:00
steve bbdf03b457 1) setlinebuf() for vpi_trace
2) Addes error checks for trace file opens
 3) removes now extraneous flushes
 4) fixes acc_next() bug
2003-06-17 16:55:07 +00:00
steve b544b319fa Handle special case of (*). 2003-06-17 04:23:25 +00:00
steve 536b79b667 Handle bufz as buf in generic fpga/edif target. 2003-06-17 03:47:41 +00:00
steve 4da0cc4c8c Fix fprintf warning. 2003-06-16 22:14:15 +00:00
steve ad102e80de Functions can have sub-scope. 2003-06-16 00:34:08 +00:00
steve c8b18b998e Spell Yasuhisa correctly. 2003-06-16 00:33:41 +00:00
steve 1b0408ac8f More efficient code for ternary expressions. 2003-06-15 22:49:32 +00:00
steve 222eaa0f88 Operands of unsigned multiply are unsigned. 2003-06-15 18:53:20 +00:00
steve d2188b8f6d Snapshot 20030614. 2003-06-14 22:20:19 +00:00
steve 2f6826247a Sign extend signed vectors. 2003-06-14 22:18:54 +00:00
steve 4709c3e012 ihand is system task, not scope. 2003-06-14 01:16:17 +00:00
steve 54e809ffa4 Include verbose messages in log output. 2003-06-13 19:51:08 +00:00
steve a9ce23d2e9 Add a bunch more PLI1 routines. 2003-06-13 19:23:41 +00:00
steve 3ef65d1298 Properly manage real variables in subscopes. 2003-06-13 19:10:45 +00:00
steve b43c543455 Handle assign of real to vector. 2003-06-13 19:10:20 +00:00
steve dc90f0d52d Task/functions can have signed ports. 2003-06-13 00:27:09 +00:00
steve 83dfce00d2 support vpiVectorVal for value of thread vector. 2003-06-11 05:07:31 +00:00
steve 218693794d Use -mieee for alpha compiles. 2003-06-11 05:07:07 +00:00
steve 0c7a5874d4 Proper pad of signed constants. 2003-06-11 02:23:45 +00:00
steve 2f241ae95b Handle B and b in binary constants. 2003-06-11 01:58:21 +00:00
steve 6827aef285 PR735: bit select indices are signed constants. 2003-06-10 04:29:57 +00:00
steve 4f89e3a026 INclude missing assert.h in load_module. 2003-06-05 04:31:09 +00:00
steve 8352c91b0a Evaluate <= with real operands. 2003-06-05 04:28:24 +00:00
steve a4d69e08da Better width testing for thread vector allocation. 2003-06-05 04:18:50 +00:00
steve 1c65ea08e8 1) Adds configure logic to clean up compiler warnings
2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
   tf_isetrealdelay, acc_handle_scope
3) makes acc_next reentrant
4) adds basic vpiWire type support
5) fills in some acc_object_of_type() and acc_fetch_{full}type()
6) add vpiLeftRange/RigthRange to signals
2003-06-04 01:56:20 +00:00
steve d3daa997b5 internal error for <= expression errors. 2003-06-04 01:26:17 +00:00
steve bc91ec41f2 Add tf_strgetp functions. 2003-05-30 04:22:13 +00:00
steve 2b471d16f7 Add acc_next function. 2003-05-30 04:18:31 +00:00
steve 0555a5f182 vpi_trace of vpi_free_object. 2003-05-30 04:08:28 +00:00
steve bd459d5182 Add tf_rosynchronize and friends. 2003-05-30 04:05:32 +00:00
steve f003da6621 Add tf_scale_longdelay. 2003-05-30 04:01:55 +00:00
steve 5903f0744c Support parameters in real expressions and
as real expressions, and fix multiply and
 divide with real results.
2003-05-30 02:55:32 +00:00
steve e7b3168466 Add tf_getp/putp support for integers
and real valued arguments.

 Add tf_mipname function.
2003-05-29 03:46:21 +00:00
steve bf664c67b4 acc_fetch_type supports module. 2003-05-29 02:35:41 +00:00
steve 8cfef65bd8 Implement acc_fetch_defname and its infrastructure in vvp. 2003-05-29 02:21:45 +00:00
steve 577554cca5 Better error message for stray characters. 2003-05-28 04:21:12 +00:00
steve bf881fef0a Implement tf_inump 2003-05-28 03:38:05 +00:00
steve 031962ba32 Missing time related declarations. 2003-05-28 03:14:20 +00:00
steve ea2cef34ae Some asserts that check for thread vector overflow. 2003-05-28 03:10:52 +00:00
steve 7fa987e58d compiler warnings. 2003-05-28 02:42:43 +00:00
steve 5c34f53e9c PLI get time units/precision. 2003-05-27 16:22:10 +00:00
steve 4b20ffc829 Use set/x0/x if the target vector is too wide for set/x0. 2003-05-26 04:45:37 +00:00
steve e157b3f9c5 Add the set/x0/x instruction. 2003-05-26 04:44:54 +00:00
steve b82a2d4773 Typo type name. 2003-05-26 04:39:16 +00:00
steve c29b1639e1 Useless cast. 2003-05-25 03:04:55 +00:00
steve 5ee1b465e9 Get length of trimed unsigned value right. 2003-05-25 03:01:19 +00:00
steve 6e5b7e4a41 Add % in real expressions. 2003-05-25 02:50:08 +00:00
steve 49a8d46885 Add implementation of acc_handle_by_name. 2003-05-24 03:02:04 +00:00
steve 639d3aad1e More thorough overflow error message. 2003-05-24 02:48:37 +00:00
steve e3e4e648d7 Add vpi_fopen and vpi_get_file. 2003-05-23 04:04:02 +00:00
steve 3770dda0b8 Assert that parameters fix into opcode. 2003-05-23 03:44:34 +00:00
steve 7e2848b105 Do not try to set constants to width 0. 2003-05-20 15:05:33 +00:00
steve 0d779098f0 Fix spelling of HAVE_LIBREADLINE 2003-05-20 03:48:23 +00:00
steve 17e93b7cbe Implement the wait statement behaviorally instead of as nets. 2003-05-19 02:50:58 +00:00
steve 52c1c051b0 Update to snapshot 20030518. 2003-05-18 17:48:52 +00:00
steve ea33862632 Add PLI_TRACE tracing of PLI1 modules.
Add tf_isetdelay and friends, and add
 callback return values for acc_vcl support.
2003-05-18 00:16:35 +00:00
steve cd7a313f56 Account for nested fork scopes in disable. 2003-05-17 04:38:19 +00:00
steve 218d74f7bb Fallback functionality if readline is not present. 2003-05-16 03:50:28 +00:00
steve 11058017df Compile with -fPIC flag. 2003-05-16 03:23:17 +00:00
steve 8126bdd384 Use fopen64 to open output file. 2003-05-16 03:22:52 +00:00
steve 2e3ce49400 Arrange for mcd id=00_00_00_01 to go to stdout
as well as a user specified log file, set log
 file to buffer lines.

 Add vpi_flush function, and clear up some cunfused
 return codes from other vpi functions.

 Adjust $display and vcd/lxt messages to use the
 standard output/log file.
2003-05-15 16:51:08 +00:00
steve 04d32a4d4c Return all 64bits of time in vpi_get_time. 2003-05-15 01:24:46 +00:00
steve f37213e7e6 Eliminate some redundant vpi_put_values. 2003-05-15 00:38:29 +00:00
steve 2a29c4fd62 Support real expressions in case statements. 2003-05-14 05:26:41 +00:00
steve 889b9bfe07 Use seed to store random number context. 2003-05-14 04:18:16 +00:00
steve 2356741169 Clear pin pointers if pin is not connected. 2003-05-13 16:30:39 +00:00
steve 3bd08e6212 Allow primitives to hvae unconnected input ports. 2003-05-13 01:56:15 +00:00
steve d9b86d9b3a $readmem more flexible with file name argument. 2003-05-10 16:06:50 +00:00
steve 2a93dc00f6 Proper width handling of || expressions. 2003-05-10 02:38:49 +00:00
steve a5298eef46 Account for newer (2.5.31) flex. 2003-05-08 16:20:17 +00:00
steve 5e07cd7e6e Improve internal error message. 2003-05-07 19:56:20 +00:00
steve 4ace97a083 ufunc calls to functions can have scheduling complexities. 2003-05-07 03:39:12 +00:00
steve 84b0ca822b Prepare for 20030504 snapshot. 2003-05-04 20:58:58 +00:00
steve 1b7c876fd8 Event callbacks support vpi_remove_cb. 2003-05-04 20:43:36 +00:00
steve d958fd2c36 Fix truncation of signed constant in constant addition. 2003-05-04 20:04:08 +00:00
steve afb7a48b29 Add reference to link from Yasukisa Kato. 2003-05-04 19:31:51 +00:00
steve aff5b7fadf Certain constants are allowed as mcd parameters. 2003-05-02 15:45:43 +00:00
steve 7733a0a620 $fdisplay can have a RealVar, not RealVal argument. 2003-05-02 04:44:41 +00:00
steve 78a2ef04a9 Add put_value with transport delay. 2003-05-02 04:29:57 +00:00
steve 76295ac873 More complete bit range internal error message,
Better test of part select ranges on non-zero
 signal ranges.
2003-05-01 01:13:57 +00:00
steve 8df9bb3840 Remove veriusertfs stuf. 2003-04-30 01:28:06 +00:00
steve ea3048fb96 Conditionally include malloc.h 2003-04-30 01:09:29 +00:00
steve cb0a9b254e More 2001 port declaration support. 2003-04-28 17:50:57 +00:00
steve 06b4f3cd58 Snapshot 20030427. 2003-04-28 01:08:09 +00:00
steve ab6b9312f2 Fix stringheap list management failure. 2003-04-28 01:03:11 +00:00
steve d88d876501 Better guess of defualt ternary width. 2003-04-27 16:33:16 +00:00
steve 60229d96a5 Support vpiScaledRealTime. 2003-04-27 04:19:24 +00:00
steve 789b278ec5 Capture VCD dump value in the rosync time period. 2003-04-27 02:22:27 +00:00
steve 65c8722d72 Handle X values in constant == nets. 2003-04-25 05:06:32 +00:00
steve 6df92f7cca Properly skip cancelled callbacks. 2003-04-25 04:36:42 +00:00
steve 58f6755fa7 Ansi port declaration can take a list. 2003-04-25 02:28:53 +00:00
steve aa47ff5653 Add acc_fetch_fulltype function. 2003-04-24 18:57:05 +00:00
steve cdbf21a92d NetSubsignal inherits port type from source. 2003-04-24 05:26:25 +00:00
steve 5b726e09af Include port name in port assignment error message. 2003-04-24 05:25:55 +00:00
steve 928cee9dab Dump design even on errors. 2003-04-24 05:25:27 +00:00
steve 351485f066 Clean up some simple warnings. 2003-04-24 02:02:37 +00:00
steve 11b9adfa40 Add tf_synchronize and tf_multiply_long. 2003-04-23 15:01:29 +00:00
steve d5642e6bdf Preserve user specifiec CFLAGS/CPPFLAGS. 2003-04-23 05:27:44 +00:00
steve d9568263a3 Accept string parameters for file name argument. 2003-04-23 04:57:41 +00:00
steve 54ea845f34 VPI Access to named events. 2003-04-23 03:09:25 +00:00
steve 3aa3d03397 Fix word register leak. 2003-04-23 02:22:47 +00:00
steve f1cc9d865b Support event names as expressions elements. 2003-04-22 04:48:29 +00:00
steve 299f6f8551 acc_fetch_value support for %v format. 2003-04-20 02:49:07 +00:00
steve c75140592f Support value change callbacks. 2003-04-20 02:48:39 +00:00
steve 59aa9052f8 Add support for cbNextSimTime. 2003-04-19 23:32:57 +00:00
steve 92a44db0b8 Arrange link order to find local libraries before installed libraries. 2003-04-19 22:37:10 +00:00
steve 58f5955687 Less picky about expression widths while synthesizing ternary. 2003-04-19 04:52:56 +00:00
steve 2879ed4388 Set line number for ternary expressions. 2003-04-19 04:19:38 +00:00
steve 772a8b7dac Handle real constants evaluation > and >=. 2003-04-15 05:06:56 +00:00
steve bab0924d86 Make some effort to preserve bits while
operating on constant values.
2003-04-14 03:40:21 +00:00
steve 561a268c9c Break sized constants into a size token
and a based numeric constant.
2003-04-14 03:37:47 +00:00
steve 3b17456254 Properly pass $signed(signal) to tasks. 2003-04-12 23:25:20 +00:00
steve 6035a7c143 spec file for 20030412 snapshot 2003-04-12 20:20:42 +00:00
steve 77cadcdf22 Update spec with new pli files. 2003-04-12 19:19:21 +00:00
steve e972f9c557 Add the swift.txt documentation. 2003-04-12 19:19:03 +00:00
steve 07b7bf3084 More acc_ function stubs. 2003-04-12 18:57:13 +00:00
steve 8ac644c746 Add vpoiScalarVal support for signals. 2003-04-12 18:56:57 +00:00
steve 5d1d99a89f Handle signed magnitude compare all the
way through to the vvp code generator.
2003-04-11 05:18:08 +00:00
steve 2c1e36ae9a Add signed versions of .cmp/gt/ge 2003-04-11 05:15:38 +00:00
steve 58f2fe73c8 Detect constant shift distances in synthesis. 2003-04-08 05:07:15 +00:00
steve 2c129dfbfa Synthesize shift expressions. 2003-04-08 04:33:55 +00:00
steve aad7816949 Move library cell management to common file. 2003-04-05 05:53:34 +00:00
steve 15fa7246f2 Fix LUT function for chained NE. 2003-04-05 01:35:40 +00:00
steve 882c46437c Add == and some lut logic. 2003-04-04 06:20:29 +00:00
steve 6495d0bd5d Add xlibrary celltable. 2003-04-04 04:59:03 +00:00
steve 47060bfedd Prevent overrun comparing verinums to zero. 2003-04-03 04:30:00 +00:00
steve 6fcbc0e59a Fix xz extension of constants. 2003-04-02 04:25:26 +00:00
steve 1ef01b404e Cope with empty module ports while binding by name. 2003-04-02 03:00:14 +00:00
steve 4987558a56 Mention required readline and termcap libraries. 2003-04-02 02:55:11 +00:00
steve e4ddf1e8c0 Propagate output of sequential udp like non-blocksing assign. 2003-04-01 05:32:56 +00:00
steve 9531aafaf2 Wide shift of MUX was wrong. 2003-03-31 01:34:19 +00:00
steve aa9ab7e09c Fix wrong input constant to bottom of GE. 2003-03-31 00:25:19 +00:00
steve 2be1b1a096 Proper sliced >= comparator. 2003-03-31 00:04:21 +00:00
steve 3878f3c770 Handle wide ports of macros. 2003-03-30 03:43:44 +00:00
steve 6e01d390bf Export symbols related to parameters. 2003-03-30 01:38:04 +00:00
steve d18934d444 Sign extend NetMult inputs if result is signed. 2003-03-29 05:51:25 +00:00
steve 4b543de7f9 Add support for division of real operands. 2003-03-28 02:33:56 +00:00
steve 4e182ebf67 Some better internal error messages. 2003-03-26 06:16:38 +00:00
steve 71bd810531 Evaluate > and < in constant expressions. 2003-03-26 06:16:18 +00:00
steve 38ebbd23c7 Handle defaults in synthesized case statements. 2003-03-25 04:04:29 +00:00
steve 9a1612b99b Scope names can be relative. 2003-03-25 03:00:04 +00:00
steve f354c43941 Use hash code for scope labels. 2003-03-25 02:15:48 +00:00
steve a49df16d44 Give proper basenames to PAD signals. 2003-03-24 02:29:04 +00:00
steve 004b377701 Document the virtex2 architecture. 2003-03-24 02:28:38 +00:00
steve ff032fa18c Add new virtex2 architecture family, and
also the new edif.h EDIF management functions.
2003-03-24 00:47:54 +00:00
steve 20c0d8f3ba Add bx support for udps. 2003-03-18 01:36:14 +00:00
steve 6b71345142 Add the q edge flag. 2003-03-18 01:32:33 +00:00
steve b21dba8fc4 Fix warning about uninitialized variable. 2003-03-18 01:21:49 +00:00
steve 1afad677e9 Make a safe copy of const string values. 2003-03-17 23:47:25 +00:00
steve 99b1cb0f74 Implement $itor and $bitstoreal 2003-03-17 21:59:54 +00:00
steve c602d94cef Comparison operators do have defined width. 2003-03-15 18:08:43 +00:00
steve 7a752bd111 More resilient WRT right expression width of GT. 2003-03-15 18:07:58 +00:00
steve 90de3904f4 Minor tweaks to iterated rules,
Add some missing uninstall removes.
2003-03-15 05:47:51 +00:00
steve 08154ec4d1 Remove excess assignment. 2003-03-15 05:44:50 +00:00
steve a281675348 free argument iterators. 2003-03-15 05:42:39 +00:00
steve 6d94f2ea55 Better organize the NetESFunc return type guesses. 2003-03-15 04:46:28 +00:00
steve 06d5c8135c Allow real-valued vpi functions to have arguments. 2003-03-15 04:45:18 +00:00
steve 857ec1079a Refix vpiRealVal scaling of time. 2003-03-14 18:01:00 +00:00
steve f2106416a7 Document VPI_TRACE tracing. 2003-03-14 05:35:16 +00:00
steve 380a52cde7 More detail in vpi tracing. 2003-03-14 05:02:34 +00:00
steve a6e0e34c6e Streamline parameter string value, get paramete scope. 2003-03-14 05:02:13 +00:00
steve d34045b904 vpiModule handle of scope is parent scope. 2003-03-14 05:01:22 +00:00
steve fd4985cc62 Support vpi_get of vpiTimeUnit. 2003-03-14 05:00:44 +00:00
steve d11ad87c4c Better message when asserting funky value type. 2003-03-14 04:59:54 +00:00
steve 9e63c88809 Free the iterator when Im done. 2003-03-14 04:58:50 +00:00
steve e6db4113a5 Warnings about long long time. 2003-03-13 20:31:40 +00:00
steve c37153b604 Verilog 2001 standart types. 2003-03-13 18:26:12 +00:00
steve fd95cffad4 remember to uninstall _pli_types.h 2003-03-13 16:33:25 +00:00
steve 8188e8f3bf Use %p name for all LPM functors. 2003-03-13 06:07:11 +00:00
steve 399b3be499 Declaration warnings. 2003-03-13 05:07:46 +00:00
steve 8d0cb2aa7f signed/unsigned warnings. 2003-03-13 05:07:10 +00:00
steve 9e9326cc6d Use rbufs instead of static buffers. 2003-03-13 04:59:21 +00:00
steve f45fd155c4 Remove the obsolete functor delete functions. 2003-03-13 04:36:57 +00:00
steve 155eb70d65 More details about the Cygwin parts. 2003-03-13 04:35:49 +00:00
steve 963b0c5952 Add a bunch of new acc_ and tf_ functions. 2003-03-13 04:35:09 +00:00
steve c2ce8bb26b Add VPI_TRACE tracing of VPI calls.
vpi_handle_by_name takes a const char*.
2003-03-13 04:34:18 +00:00
steve 60deeb0182 Donot rely on persistence of format string. 2003-03-12 03:11:00 +00:00
steve 385a688830 Add VPI tracing. 2003-03-12 02:50:32 +00:00
steve e3dc9ca70b Move _vpiNexisId safely out of the way. 2003-03-12 02:49:38 +00:00
steve 1222153cdf Keep parameter constants for the ivl_target API. 2003-03-10 23:40:53 +00:00
steve 7e9095acf2 Add support for $rtoi 2003-03-10 23:40:10 +00:00
steve 654ad4c97e Direct support for string parameters. 2003-03-10 23:37:07 +00:00
steve 66697ca6e9 Account for constants being vpiParameters. 2003-03-10 20:52:42 +00:00
steve aff8faf44d More carful about shifting beyond word size. 2003-03-10 19:14:27 +00:00
steve f78e014022 Updated mingw build instructions. 2003-03-08 21:00:01 +00:00
steve 2b543ddf16 Missing include ctype.h. 2003-03-08 20:59:41 +00:00
steve 90d1877856 Include LDFLAGS in build lines. 2003-03-08 20:59:23 +00:00
steve bd8eb7f2ca Account for bz2 library on Windows. 2003-03-08 20:58:55 +00:00
steve 1507dcd56d More C-like use of vlltype. 2003-03-08 20:58:18 +00:00
steve 6474c5c9f4 Excess precision breaks some targets. 2003-03-08 01:04:01 +00:00
steve 12d432d94d Use strtod to convert text to doubles. 2003-03-07 06:10:13 +00:00
steve 258013f99f Raw dump of double values for testing purposes. 2003-03-07 06:04:58 +00:00
steve f40ea15cce Implement $realtobits. 2003-03-07 02:44:33 +00:00
steve 0aaf0218ca Support vector put of function return values. 2003-03-07 02:44:14 +00:00
steve 5adf99059d Handle general $function arguments as expresions. 2003-03-07 02:43:32 +00:00
steve cc1e952d0b Add means to suppress wveform output 2003-03-06 20:04:42 +00:00
steve 658706ad8b lex_strings.add module names earlier. 2003-03-06 04:37:12 +00:00
steve 9c973efa9d Wrong sense of need compared to have. 2003-03-06 04:32:40 +00:00
steve ef47ea31fa Use hashed name strings for identifiers. 2003-03-06 04:32:00 +00:00
steve 22d392a75c Obsolete the ivl_event_name function. 2003-03-06 01:24:37 +00:00
steve 0bf901e9bb Use number for event labels. 2003-03-06 01:17:46 +00:00
steve badad63ab4 All NetObj objects have lex_string base names. 2003-03-06 00:28:41 +00:00
steve 26546c1bd8 Fill in required fields when getting time. 2003-03-06 00:27:54 +00:00
steve 17ec5d7891 Use numbers for functor labels. 2003-03-06 00:27:09 +00:00
steve e6e0396ecb Restore verireal constructor to match vvp processing of reals. 2003-03-05 03:45:01 +00:00
steve 44748ea86b Add support for sizes in %f format. 2003-03-05 02:58:04 +00:00
steve 1e73cf82a6 Use sscanf to make doubles from strings. 2003-03-05 02:36:05 +00:00
steve 59f820aacd Include all libs, not just extra libs. 2003-03-04 03:13:57 +00:00
steve edffdb5702 Include LDFLAGS on link line. 2003-03-04 03:13:07 +00:00
steve 76a77fdd36 Printed nexus names need not use ivl_nexus_name. 2003-03-03 23:05:49 +00:00
steve 85991e88e8 Support vpiName for system task/function calls. 2003-03-03 03:27:35 +00:00
steve 486274cfa1 Scope names stored only as basename. 2003-03-03 02:22:41 +00:00
steve 679c9c5bfe Only give scope basename to .scope directives. 2003-03-03 01:48:41 +00:00
steve c4f57e74ee .scope directives store only the base names. 2003-03-03 01:47:50 +00:00
steve 4c67de5ca7 Add the lex_strings string handler, and put
scope names and system task/function names
 into this table. Also, permallocate event
 names from the beginning.
2003-03-01 06:25:30 +00:00
steve 411098117a no whole_archive flag on openbsd. 2003-03-01 06:24:06 +00:00
steve c2f90ac911 Careful about compiletf calls. 2003-03-01 00:46:13 +00:00
steve 21b0f4955e Allow read of realvar as int. 2003-02-28 21:20:34 +00:00
steve 970c4950f4 Merge vpi_call and vpi_func draw functions. 2003-02-28 20:21:13 +00:00
steve feee40603c Makefile cleanups to better support concurrent make. 2003-02-27 22:13:22 +00:00
steve 3a653c73e7 Add scope type have a vpi_get function. 2003-02-27 21:54:44 +00:00
steve 514bb4a6a9 Handle assign of real values to vectors. 2003-02-27 20:38:12 +00:00
steve aa3297a925 Add the cvt/vr instruction. 2003-02-27 20:36:29 +00:00
steve e58030498f specparams as far as pform. 2003-02-27 06:45:11 +00:00
steve a275133ff9 LPM objects store only their base names. 2003-02-26 01:29:24 +00:00
steve c62a53ad27 Document new PLI1 bootstrap interface. 2003-02-26 01:25:51 +00:00
steve 9ceaaa5faf ivl_lpm_name is obsolete. 2003-02-26 01:24:35 +00:00
steve e6eded243e Eliminate use of ivl_lpm_name function. 2003-02-25 03:40:45 +00:00
steve d8706979ae Eliminate use of ivl_lpm_name. 2003-02-25 03:39:53 +00:00
steve 5ca6991067 Some error messages around asserts. 2003-02-25 01:17:28 +00:00
steve fc062c3b63 Add the check make target. 2003-02-24 22:35:56 +00:00
steve 70daee399f Interactive task calls take string arguments. 2003-02-24 06:35:45 +00:00
steve 7f8433148c Add to interactive stop mode support for
current scope, the ability to scan/traverse
 scopes, and the ability to call system tasks.
2003-02-23 06:41:54 +00:00
steve 5b7c1bc7e2 Basic support for system task calls. 2003-02-22 06:32:36 +00:00
steve 2935e28ffb When checking for stop, remember to reschedule. 2003-02-22 06:26:58 +00:00
steve 94914382c2 portbind adds p, not i, flag. 2003-02-22 04:55:36 +00:00
steve 1951a81a0b Use ranlib where available, for MacOSX 2003-02-22 04:39:32 +00:00
steve 6fab2e3651 Detect whole_archive flags in configure. 2003-02-22 04:29:14 +00:00
steve cd572a74ce Add the portbind warning. 2003-02-22 04:12:49 +00:00
steve eeb056b8d9 Only include malloc.h if it is present. 2003-02-22 04:04:38 +00:00
steve 19c6bd2139 Check for stopped flag in certain strategic points. 2003-02-22 02:52:06 +00:00
steve 2de0597038 Add vpiStop and interactive mode. 2003-02-21 03:40:35 +00:00
steve fbac08200d Make the $stop system task really vpiStop. 2003-02-21 03:24:03 +00:00
steve a4be33026d Move dumpon/dumpoff around to the right times. 2003-02-21 01:36:25 +00:00
steve de4bfe4e4f Document new -lxt and -vcd extended arguments. 2003-02-20 00:50:28 +00:00
steve 62ef34ea04 Update lxt_write implementation, and add compression control flags. 2003-02-20 00:50:06 +00:00
steve 9e63ed305d detect -lz and -lbz2 libraries. 2003-02-20 00:49:24 +00:00
steve 3b1cdaa9bf fullname for accConstant. 2003-02-19 04:37:04 +00:00
steve ae0788682a Notes on hte bug database. 2003-02-19 04:36:31 +00:00
steve d3de1d9c33 Add at least minimal implementations for several
acc_ functions. Add support for standard ACC
 string handling.

 Add the _pli_types.h header file to carry the
 IEEE1364-2001 standard PLI type declarations.
2003-02-17 06:39:47 +00:00
steve ec48049a69 Strict correctness of vpi_free_object results. 2003-02-17 00:58:38 +00:00
steve 8f99365e9a Use a variant of ivl_dlfcn to do dynamic loading
from within the cadpli module.

 Change the +cadpli flag to -cadpli, to keep the
 plusargs namespace clear.
2003-02-17 00:01:25 +00:00
steve 74192632fa Permanent allocate vpiSignals more efficiently. 2003-02-16 23:40:05 +00:00
steve a94ca97d36 NaN in dead zones of VCD dumps. 2003-02-16 23:39:08 +00:00
steve fe4546498b Take the global_flag to ivl_dlopen. 2003-02-16 05:42:06 +00:00
steve 7930398a25 Export new symbols. 2003-02-16 05:41:40 +00:00
steve 41e54499c9 Add the cadpli HOWTO. 2003-02-16 02:44:47 +00:00
steve d8761211a4 Add the cadpli interface module. 2003-02-16 02:23:54 +00:00
steve f00a6e5419 Change the IV veriusertfs_register to accept table pointers. 2003-02-16 02:23:14 +00:00
steve 66785b7997 Support .vpl files as loadable LIBRARIES. 2003-02-16 02:21:20 +00:00
steve d0728add45 Make lxt use stringheap to perm-allocate strings. 2003-02-13 18:13:28 +00:00
steve 25d47ec6df Set dumpoff of real variables to NaN. 2003-02-12 05:28:01 +00:00
steve 83ee6fc818 Support dump of vpiRealVar objects. 2003-02-11 05:21:33 +00:00
steve 2713694338 Include vpiRealVar objects in vpiVariables scan. 2003-02-11 05:20:45 +00:00
steve 32088821c0 Support monitor of real variables. 2003-02-10 05:20:48 +00:00
steve dcbb8d0780 Add value change callbacks to real variables. 2003-02-10 05:20:10 +00:00
steve b726395d1e Spelling fixes. 2003-02-09 23:33:26 +00:00
steve 929f0f5f00 Support C-style comments in read data file. 2003-02-09 05:07:06 +00:00
steve e571dd90d8 Calculate delay statement delays using elaborated
expressions instead of pre-elaborated expression
 trees.

 Remove the eval_pexpr methods from PExpr.
2003-02-08 19:49:21 +00:00
steve 26b755d544 Fix handling of inline decloration without wire keyword. 2003-02-07 23:16:09 +00:00
steve 79b2beb588 Store real values as native double. 2003-02-07 06:13:44 +00:00
steve 55af069fe8 Rewrite delay statement elaboration of handle real expressions. 2003-02-07 02:49:24 +00:00
steve f8d1e15a27 NetEBDiv handles real value constant expressions. 2003-02-07 02:47:57 +00:00
steve 7638ec05e7 Handle real value subtract and comparisons. 2003-02-07 02:46:16 +00:00
steve 3c18663c3f Mke getopt ignore options after the file name. 2003-02-07 02:45:05 +00:00
steve b230bec586 Properly round inter time values from $time. 2003-02-07 02:44:25 +00:00
steve a07b3dccc4 Edge of vectors notes. 2003-02-06 17:51:36 +00:00
steve 589422b505 Real constants have no defined vector width 2003-02-06 17:50:23 +00:00
steve dd56d9a17c Add the %sub/wr instruction. 2003-02-06 17:41:47 +00:00
steve 68de9bf5d2 Support constant types for thread words. 2003-02-06 17:41:33 +00:00
steve 03afae4da4 Format real values as time. 2003-02-06 17:40:02 +00:00
steve 2637566fe9 Satisfy declaration requirements of some picky compilers. 2003-02-06 16:43:20 +00:00
steve 967eec5786 Rearrange format-string formatting code. 2003-02-04 04:06:36 +00:00
steve be4be5c650 Add hex and binary formatting of real values. 2003-02-04 04:03:40 +00:00
steve ce489d8d84 Allow $display of $simtime. 2003-02-03 01:09:20 +00:00
steve d188e5cd2e Macros can be expanded in quoted strings. 2003-02-03 00:28:12 +00:00
steve a45803f00f Better handling of comments in defines. 2003-02-02 23:54:35 +00:00
steve 9adbdcb7c5 Add support for signed ports and nets. 2003-02-02 19:02:39 +00:00
steve b0f7c33ab1 Fix missing return from decimal parse. 2003-02-02 18:58:36 +00:00
steve 27f7a00df0 Proper rounding of scaled integer time. 2003-02-02 02:14:14 +00:00
steve 222f15c293 Five vpi_free_object a default behavior. 2003-02-02 01:40:24 +00:00
steve ff2ec85b61 Fix conversion of signed numbes to long 2003-02-02 00:43:16 +00:00
steve 53f35b5284 Terminate bits string from ivl_expr_bits. 2003-02-02 00:19:27 +00:00
steve 844cfc5137 Allow parameter expressions to be type real. 2003-02-01 23:37:34 +00:00
steve e3d6c29c8f Real variables now work, remove from unsupported list. 2003-02-01 23:35:48 +00:00
steve fec6a10771 Make $time and $realtime available to $display uniquely. 2003-02-01 05:50:04 +00:00
steve e549a2c5c3 Display $time and $realtime specially. 2003-02-01 05:49:13 +00:00
steve e941e7e805 Spelling fixes. 2003-01-30 16:23:07 +00:00
steve 8f4afd53a6 include config.h to get iosfwd flags. 2003-01-30 04:23:25 +00:00
steve 9bb27b1e8d Add missing net_variable.cc to CVS. 2003-01-28 16:23:27 +00:00
steve 971cd51d76 Use more precise pow function to scale time by units. 2003-01-28 04:41:55 +00:00
steve de4c73abcb Deliver residual bits of real value. 2003-01-28 04:15:50 +00:00
steve 8f0c02c0fa Spelling fixes. 2003-01-27 05:09:17 +00:00
steve 04ada23119 Support in various contexts the $realtime
system task.
2003-01-27 00:14:37 +00:00
steve 46253ed873 Rework expression parsing and elaboration to
accommodate real/realtime values and expressions.
2003-01-26 21:15:58 +00:00
steve 1a9ab8ec84 Remember to save signedness of number. 2003-01-26 21:02:21 +00:00
steve 47db309d30 Support display of real values and constants. 2003-01-26 18:18:36 +00:00
steve 7de4108bad Add %cvt/ir and %cvt/ri instructions, and support
real values passed as arguments to VPI tasks.
2003-01-26 18:16:22 +00:00
steve 9a5a00f836 Add thread word array, and add the instructions,
%add/wr, %cmp/wr, %load/wr, %mul/wr and %set/wr.
2003-01-25 23:48:05 +00:00
steve 07a427bf28 Detect null arguments to concatenation operator. 2003-01-19 00:35:39 +00:00
steve dfc9a9474a Add a dummy function to reduce confusion on some systems. 2003-01-19 00:03:23 +00:00
steve 54206ef92b Make sure to use local system.vpi. 2003-01-18 23:56:06 +00:00
steve ddd43f1378 Add a means to clear the module search path. 2003-01-18 23:55:35 +00:00
steve 38ccb12eb0 Use stringstream in place of sprintf. 2003-01-17 05:49:03 +00:00
steve ca3bf14fb6 Remove useless variable. 2003-01-17 05:48:35 +00:00
steve 982474899b Set proper line text for later bison. 2003-01-17 05:48:02 +00:00
steve ad6ff5562d Missed a case of setting line on an PEident. 2003-01-17 05:47:30 +00:00
steve d4cd1dbd27 Keep some debugging status. 2003-01-16 21:44:46 +00:00
steve 3c1426e631 Detect duplicate module declarations. 2003-01-16 21:44:19 +00:00
steve c3a1a9514f Assert some task definition sanity. 2003-01-16 21:43:52 +00:00
steve f56d763411 Move strstream to ostringstream for compatibility. 2003-01-14 21:16:18 +00:00
steve 4ec91047dd Ignore vvp.exp 2003-01-10 19:02:47 +00:00
steve 0579ae08cd Add missing vpi entry points. 2003-01-10 19:02:21 +00:00
steve 9074999666 Remove thunks from vpi init. 2003-01-10 19:01:38 +00:00
steve 0458ab5a53 Only use libiberty.h if available. 2003-01-10 19:01:04 +00:00
steve 4a3459c87c Spelling fixes. 2003-01-10 03:08:13 +00:00
steve 301cbe31ad Remove vpithunk, and move libvpi to vvp directory. 2003-01-10 03:06:32 +00:00
steve 165dd82bb2 Remove files of vvm directory. 2003-01-10 03:05:05 +00:00
steve 9c3b3246c8 use userdata to save $display argument handles. 2003-01-09 04:10:58 +00:00
steve 6416f8b90e Add vpi_put_userdata 2003-01-09 04:09:44 +00:00
steve e6eae5fd15 Allocate res-buf in bigger chunks 2003-01-07 18:07:50 +00:00
steve aa3a6dba4e Schedule wait lists of threads as a single event,
to save on events. Also, improve efficiency of
 event_s allocation. Add some event statistics to
 get an idea where performance is really going.
2003-01-06 23:57:26 +00:00
steve dedae73761 Account for local units in calculated delays. 2002-12-21 19:42:17 +00:00
steve d7f3d00f5c Rewrite time formatting to account for local scope. 2002-12-21 19:41:49 +00:00
steve c2070777b2 The $time system task returns the integer time
scaled to the local units. Change the internal
 implementation of vpiSystemTime the $time functions
 to properly account for this. Also add $simtime
 to get the simulation time.
2002-12-21 00:55:57 +00:00
steve 42b34c2ce6 Evaluate shift index after shift operand because
the chift operand may use the index register itself.
2002-12-20 01:11:14 +00:00
steve 6fbfdd8f3f Keep bit select subexpression width if it is constant. 2002-12-19 23:11:29 +00:00
steve bee3acfd12 Add tf_message, tf_get/setworkarea, and
ty_typep functions, along with defines
 related to these functions.
2002-12-19 21:37:04 +00:00
steve 2e279b61dd Update to 0.7 release. 2002-12-14 18:20:14 +00:00
steve 8ab909a765 Add vpi_handle_by_name to the VPI interface,
and bump the vpithunk magic number.
2002-12-11 23:55:22 +00:00
steve cca07fa42d Account for bison 1.35 and stack manipulations. 2002-12-10 05:49:51 +00:00
steve 5b81798205 install iverilog-vpi as a script. 2002-12-10 05:45:44 +00:00
steve a8a82df47d Prepare for 20021207 snapshot 2002-12-08 03:06:30 +00:00
steve e62e1d89b6 Named event triggers can take hierarchical names. 2002-12-07 02:49:24 +00:00
steve c032186133 Reword some error messages for clarity. 2002-12-06 03:08:19 +00:00
steve b89e138404 precalculate r-values of nb assignments and task arguments. 2002-12-05 04:15:14 +00:00
steve 9f80ed32b6 Support bit select in constant expressions. 2002-12-05 02:14:33 +00:00
steve c16a4a3950 distclean target. 2002-12-04 03:33:38 +00:00
steve 90fa90a508 Mingw32 compatible temp file management. 2002-12-04 03:26:59 +00:00
steve aaa734690f Use O_EXCL when opening temp files. 2002-12-04 02:29:36 +00:00
steve 88da7804c4 Improve the bad character error message. 2002-12-04 02:07:00 +00:00
steve 8604f922a5 specify delay can take an unbracketed simple value. 2002-11-26 03:56:10 +00:00
steve 807a758f7c Do not set width if width is already OK. 2002-11-26 03:35:13 +00:00
steve ef55086543 Support put of vpiStringVal to signals. 2002-11-25 23:33:45 +00:00
steve 2001903c89 Cygwin doesnot need driver-vpi sibdirectory. 2002-11-24 02:27:28 +00:00
steve 751e4e4c79 Fix instanceRef spelling. 2002-11-24 02:26:14 +00:00
steve 9d91b5db4c Document the Windows specific flags. 2002-11-23 00:51:53 +00:00
steve 9a3c9507ed Handle wide AND/NOR devices with Virtex carry logic. 2002-11-22 05:46:06 +00:00
steve d71d52bfe9 Implement bufif1 as BUFT 2002-11-22 01:45:40 +00:00
steve 8e30bc9f9e Careful of left operands to shift that are constant. 2002-11-22 00:01:50 +00:00
steve 412518d1ca Precalculate indices to l-value arrays. 2002-11-21 23:27:51 +00:00
steve 03afbf157b %set/x0 instruction to support bounds checking. 2002-11-21 22:43:13 +00:00
steve 00b2d467e4 Allow right values of right shift to shift in. 2002-11-21 22:42:48 +00:00
steve 856829d299 Fix const test of msb in assignment l-values. 2002-11-21 18:15:40 +00:00
steve 2fafe6866f Better handling of select width of shifters. 2002-11-21 18:08:09 +00:00
steve b9188ad0ca PATHPULSE specparam assignment syntax. 2002-11-21 17:40:11 +00:00
steve 0ccb9139c9 Magnitude compare to 0. 2002-11-17 23:37:55 +00:00
steve 18e402ddc8 Close old file if $dumpfile is called again. 2002-11-17 22:28:42 +00:00
steve b82d3165da Update version strings in spec flie. 2002-11-17 18:38:03 +00:00
steve 91580d1fcc Generate unique labels for force functors. 2002-11-17 18:31:09 +00:00
steve 35d7384903 Handle default: case in net_inputs for NetCase. 2002-11-16 05:45:41 +00:00
steve 4539632f34 Add vpiScope iterate on vpiScope objects. 2002-11-15 22:14:12 +00:00
steve 0651f246b2 Save vpiFullName results. 2002-11-14 22:43:58 +00:00
steve 6d0dee9341 Add version resources to the Windows binary. 2002-11-13 17:25:10 +00:00
steve c692f1708c Allow -mingw and -ivl flags to stand alone. 2002-11-13 17:03:49 +00:00
steve d91733d32c Spell the iverilog-vpi target correctly. 2002-11-13 16:57:25 +00:00
steve cd7378ff3f Do not truncate high bits of right shift. 2002-11-13 03:03:08 +00:00
steve c98ce4a029 Add Windows version of iverilog-vpi. 2002-11-13 01:50:11 +00:00
steve d035a7e92c spelling error. 2002-11-13 01:49:43 +00:00
steve 6db6359363 Update Solaris packaging to to realities. 2002-11-11 15:49:03 +00:00
steve 5c07a29e46 Install sqrt-virtex.v under Windows. 2002-11-11 01:12:41 +00:00
steve 42d9094e9b Snapshot 20021109 2002-11-09 23:41:15 +00:00
steve 1742231eba Handle nested-if chip enables. 2002-11-09 23:29:29 +00:00
steve 3178f886b7 XNF target uses only legacy functors. 2002-11-09 23:29:02 +00:00
steve cbc4a0ab52 Detect synthesis conflicts blocks statements share outputs. 2002-11-09 20:22:57 +00:00
steve cfd8cbf850 Port expressions for output ports are lnets, not nets. 2002-11-09 19:20:48 +00:00
steve 013b18b3dc leading underscore test for Windows more robust. 2002-11-09 06:03:57 +00:00
steve db9f20b21a Macos install notes. 2002-11-09 06:03:38 +00:00
steve f611260089 display octal escapes properly. 2002-11-09 06:01:11 +00:00
steve e34e3a4875 spelling in a comment. 2002-11-09 02:22:07 +00:00
steve aa8869a3c7 Postpone parameter width check to evaluation. 2002-11-09 01:40:19 +00:00
steve 588931fcf2 Add dup_expr for user defined function calls. 2002-11-09 00:25:27 +00:00
steve 07e49e215e Use the vectorized %assign where appropriate. 2002-11-08 05:00:31 +00:00
steve 1b84893ccb Add the %assign/v0 instruction. 2002-11-08 04:59:57 +00:00
steve 6445bb6915 Handle comments in suppressed code. 2002-11-08 00:04:16 +00:00
steve db899bd1b5 Use Vector %set to set constants in variables. 2002-11-07 05:19:55 +00:00
steve c6dcc38fe0 Vectorize load from REG variables. 2002-11-07 03:12:17 +00:00
steve b0a7909162 functor_set takes bit and strength, not 2 strengths. 2002-11-07 03:11:43 +00:00
steve d7ae85a13a Add vector set and load instructions. 2002-11-07 02:32:39 +00:00
steve 46ee38b466 Concatenation can evaluate sub-expressions in place. 2002-11-06 05:41:37 +00:00
steve bc6a958a50 More reliable iverilog.conf install dependency. 2002-11-06 03:42:40 +00:00
steve 0e751ad975 More forgiving about assignment rval width mismatch. 2002-11-06 03:22:28 +00:00
steve de94d09706 No need to keep excess width from an
unsigned constant value, if it can
 be trimmed safely.
2002-11-06 02:25:13 +00:00
steve 2f88a631df Run output with the vvp command. 2002-11-05 03:49:21 +00:00
steve 4e5dd49a37 Fix mask calculate when MOV_b is right on the word boundary. 2002-11-05 03:46:44 +00:00
steve 8463dcc878 ignore parse.output 2002-11-05 02:19:37 +00:00
steve 18bc2f65b3 Misspelled name. 2002-11-05 02:18:53 +00:00
steve b4e8ea5a0c Install shared objects as programs, not data. 2002-11-05 02:14:41 +00:00
steve 06a8087cb5 Do not need _leading underscore on Windows. 2002-11-05 02:14:16 +00:00
steve a9dfef0f55 Fix the call to FormatMessage under Windows. 2002-11-05 02:12:35 +00:00
steve e4540c3d0d Better error message for load failure on Windows. 2002-11-05 02:11:56 +00:00
steve 0cc8396244 Cast for gcc convenience. 2002-11-03 22:44:19 +00:00
steve 946693ad4d New output files from new bison. 2002-11-03 20:50:33 +00:00
steve f014d4c533 Update instructions, now that Cygwin handles X:/path strings. 2002-11-03 20:49:57 +00:00
steve 6a1e3f7e27 Slightly more verbose load fail message. 2002-11-03 20:47:23 +00:00
steve 7ad66b0725 Support old/new bison yylloc. 2002-11-03 20:36:53 +00:00
steve 0341c0c727 Error message for mising code generator type. 2002-11-03 20:36:10 +00:00
steve 20c8550139 Compiler error wrt ptrdiff_t. 2002-11-03 20:33:43 +00:00
steve 39aa90ce59 Snapshot 20021102 2002-11-03 02:12:00 +00:00
steve 6c67a64fc3 Get VectorVals from constant values. 2002-11-03 02:07:24 +00:00
steve 86032c0aa5 Allow named events to be referenced by
hierarchical names.
2002-11-02 03:27:51 +00:00
steve f243f694b4 Detect memories without work index in l-value. 2002-11-02 01:10:49 +00:00
steve 276ae3e228 Add the sqrt-virtex example. 2002-11-01 03:29:43 +00:00
steve fe6756eb07 Fix bottom bit of ADD/SUB device. 2002-11-01 02:36:34 +00:00
steve 539e494bc0 Give nets better names, if available. 2002-11-01 02:36:22 +00:00
steve 1298656c22 Fix up left shift to pass compile,
fix up ADD/SUB to generate missing pieces,
 Add the asynch set/reset to DFF devices.
2002-10-30 03:58:45 +00:00
steve c66d319d9c UPdate to 20021027 snapshot. 2002-10-28 02:26:41 +00:00
steve ae27165ffe Add Virtex code generators for left shift,
subtraction, and GE comparators.
2002-10-28 02:05:56 +00:00
steve 32f1ca6f8b draw lpm ff with aset_expr taken into account. 2002-10-23 04:39:35 +00:00
steve 9ce2806710 Fix synth2 handling of aset/aclr signals where
flip-flops are split by begin-end blocks.
2002-10-23 01:45:24 +00:00
steve 3d4593d4d5 Synthesizer support for synchronous begin-end blocks. 2002-10-21 01:42:08 +00:00
steve df5ae54ec7 Handle conditional error cases better. 2002-10-20 19:19:37 +00:00
steve fbee1b424d Properly set or clear expression lookaside for binary expressions. 2002-10-20 02:55:37 +00:00
steve 555017b525 Snapshot 20021019 2002-10-19 23:38:49 +00:00
steve 1e170ee005 bourne shell compatibility. 2002-10-19 23:18:52 +00:00
steve 43501809b1 Redo the parameter vector support to allow
parameter names in range expressions.
2002-10-19 22:59:49 +00:00
steve c0c67a101a Fix spelling of the scalared keyword. 2002-10-13 05:01:44 +00:00
steve 1eb714e097 More verbose eval_const assert message. 2002-10-13 05:01:07 +00:00
steve 54a8e12856 Fix symbol underscore needs for Mac OS X. 2002-10-03 18:03:35 +00:00
steve 6203f05ef9 Add pal target enable help message. 2002-10-03 17:57:54 +00:00
steve 703ad04067 Allow expression lookaside map to spam statements. 2002-09-27 20:24:42 +00:00
steve 778e96330d Add thread expression lookaside map. 2002-09-27 16:33:34 +00:00
steve e3eb89fb12 Remove excess debug messages. 2002-09-26 03:42:10 +00:00
steve 166621bcb3 Generate vvp code for asynch set/reset of NetFF. 2002-09-26 03:18:04 +00:00
steve 879a5a4cbe Synthesize async set/reset is certain cases. 2002-09-26 01:13:14 +00:00
steve 9faabfe995 Fix missing endifs within supressed ifdefs. 2002-09-25 02:23:08 +00:00
steve 6f23fa61ac Allow results in register bits 47 in certain cases. 2002-09-24 04:20:32 +00:00
steve 30b6cf7821 Include user specified libraries on the link line. 2002-09-24 01:50:53 +00:00
steve 6258011210 More detailed check of process edge events. 2002-09-24 00:58:35 +00:00
steve 7557a46382 Remove some now useless asserts. 2002-09-21 23:47:30 +00:00
steve a0a91f358c Snapshot 20020921 2002-09-21 21:29:09 +00:00
steve 0128286966 Allow constant bit selects out of range. 2002-09-21 21:28:18 +00:00
steve acd5e86e04 Fix disable in arbitrary fork/join situations. 2002-09-21 04:55:00 +00:00
steve ab94b0a636 disable threads with children. 2002-09-20 03:59:34 +00:00
steve de6d696667 Add support for cbAfterDelay. 2002-09-20 02:42:11 +00:00
steve 63946c4cfb More careful cd command. 2002-09-20 02:41:36 +00:00
steve 475b603d15 Relax position constrations of ifdef and friends. 2002-09-19 20:33:27 +00:00
steve 096956cda9 Fix multiple source on the command line. 2002-09-18 23:25:18 +00:00
steve 3d3116d48b Add support for binary NOR operator. 2002-09-18 04:29:55 +00:00
steve 616360d751 Spelling errors. 2002-09-18 04:08:45 +00:00
steve 7a5c30d297 printf size warning. 2002-09-18 03:34:07 +00:00
steve 9c5ab36a8b Fix switch case warnings. 2002-09-18 03:33:10 +00:00
steve 466656b167 Allow forward references of memories. 2002-09-18 02:55:18 +00:00
steve 5d6567cb02 Generate vvp code for structural flip-flops. 2002-09-17 05:37:45 +00:00
steve c44c123ef5 Connect output of block to net_out, instead of statement outputs. 2002-09-17 04:40:28 +00:00
steve 4ecbf56e2b Account for part select in l-value. 2002-09-17 04:39:20 +00:00
steve ed9a2c4b3f Proper initialization of the memories table. 2002-09-17 00:42:22 +00:00
steve 90751b9250 Reject multiple probes on synchronous logic. 2002-09-16 21:55:06 +00:00
steve 7d8011669d snapshot 20020915 2002-09-16 03:48:56 +00:00
steve eb81062d85 Add to synth2 support for synthesis of
synchronous logic. This includes DFF enables
 modeled by if/then/else.
2002-09-16 00:30:33 +00:00
steve 8fbacc966e compile error. 2002-09-16 00:28:51 +00:00
steve 75801a12e3 Display FF enables. 2002-09-16 00:28:25 +00:00
steve 9f1ce170e6 Generate code for 8:1 muxes msing F5 and F6 muxes. 2002-09-15 21:52:19 +00:00
steve 327c8826f4 Generate Virtex code for 4:1 mux slices. 2002-09-14 05:19:19 +00:00
steve fb0383d2bd single bit optimization for != in expressions,
and expand ++ and != results if needed.
2002-09-13 04:09:51 +00:00
steve 28725d0d74 Optimize ==1 when in context where x vs z doesnt matter. 2002-09-13 03:12:50 +00:00
steve dac99b9374 Add support for binary nand operator. 2002-09-12 15:49:43 +00:00
steve 1573477caf Account for buffer overrun in memory word names. 2002-09-12 15:13:07 +00:00
steve 70a7513781 Support $ in preprocessor identifiers. 2002-09-11 19:42:37 +00:00
steve 0277035496 Fix wrecked rbuf in vpi_get_str of signals and memories. 2002-09-11 16:06:57 +00:00
steve 33f462fdf6 Actually set strength pointer when getting strength val. 2002-09-10 02:27:11 +00:00
steve 639b9f346f Snapshot 20020907 2002-09-08 01:39:23 +00:00
steve 447fee6f43 Fix padding of operand of unary minus. 2002-09-08 01:37:13 +00:00
steve c9212a9a09 Implement vpi_remove_cb for cbValueChange. 2002-09-07 04:54:51 +00:00
steve ea21fab379 Add support for %v is the display system task.
Change the encoding of H and L outputs from
 the bufif devices so that they are logic x.
2002-09-06 04:56:28 +00:00
steve 4d090b64bd List tran devices as unsupported. 2002-09-04 16:19:39 +00:00
steve 7e1e44e87a Properly cast signedness of parameters with ranges. 2002-09-01 03:01:48 +00:00
steve 0a2a9dcd94 Fix leaking vthread bits in ?: eval. 2002-09-01 01:42:34 +00:00
steve c9b4b66af2 Watch for x indices in l-value of non-blocking assignments. 2002-09-01 00:19:35 +00:00
steve 7b6678b2a1 Fix reverse bit ordered bit select in continuous assignment. 2002-08-31 03:48:50 +00:00
steve e79f62c5fa Generate x out for x select on wide muxes. 2002-08-29 03:04:01 +00:00
steve 60046cc790 update for 20020828 snapshot. 2002-08-28 20:30:53 +00:00
steve 3fca25181a Evaluate nonblocking assign r-values. 2002-08-28 18:54:36 +00:00
steve cbca31555d Add the %subi instruction, and use it where possible. 2002-08-28 18:38:07 +00:00
steve d5aa700b4b Generate %load/nx for indexed load of nets. 2002-08-28 17:15:35 +00:00
steve 1db8319bce Add the %load/nx opcode to index vpi nets. 2002-08-28 17:15:06 +00:00
steve aa390f2a91 Fix l-value indexing of memories and vectors so that
an unknown (x) index causes so cell to be addresses.

 Fix tangling of label identifiers in the fork-join
 code generator.
2002-08-27 05:39:57 +00:00
steve bd9e66d333 Missing declaration of ivl_memory_scope. 2002-08-24 05:03:40 +00:00
steve c34e318f8c Fix = vs == error. 2002-08-24 05:02:58 +00:00
steve 4fc858b676 Fix missing semi-colon warning. 2002-08-24 05:02:37 +00:00
steve ac8b582b3d Rewire time formatting to handle all cases. 2002-08-24 02:02:44 +00:00
steve 6f748d3d4f Macro arguments not supported. 2002-08-24 00:52:49 +00:00
steve 2854a524f0 Watch signed comparisons, that lead to infinite loops. 2002-08-22 23:34:52 +00:00
steve 985c34bfd9 Fix behavioral eval of x?a:b expressions. 2002-08-22 03:38:40 +00:00
steve 63f97d8ec6 Carry mux output delays. 2002-08-21 02:28:03 +00:00
steve d2ac85e2c7 Copy gate delays when doing gate delay substitutions. 2002-08-20 04:12:22 +00:00
steve 1b42f6232f Support parameters with defined ranges. 2002-08-20 04:11:53 +00:00
steve 4de141ab1d Support parameters with defined ranges. 2002-08-19 02:39:16 +00:00
steve 8ab2ec6f86 Allow release to handle removal of target net. 2002-08-19 00:06:11 +00:00
steve 2fad8d4cff Detect temporaries in sequential block synthesis. 2002-08-18 22:07:16 +00:00
steve d94b0fe3c8 Terminate if the functors signal errors. 2002-08-18 22:06:29 +00:00
steve 98956ef88f Snapshot 20020817 2002-08-18 01:07:05 +00:00
steve ac21d96bd8 x in index values leads to 0. 2002-08-18 01:05:50 +00:00
steve c794aa02b8 Fix intermix of node functors and node delete. 2002-08-16 05:18:27 +00:00
steve dd564ab321 add dumpvars_compiletf to check first argument. 2002-08-15 02:12:20 +00:00
steve c0046e845e Handle special case of empty system task argument list. 2002-08-15 02:11:54 +00:00
steve 640767b748 Constants can self-size themselves in unsized contexts. 2002-08-14 03:57:27 +00:00
steve d4eaede435 Do not elide named blocks. 2002-08-13 05:35:00 +00:00
steve 52bf4e613f conditional ident string using autoconfig. 2002-08-12 01:34:58 +00:00
steve 9533a8dbdf Escape the backslash in the windows file name. 2002-08-12 01:27:48 +00:00
steve 774f78cd3e Autoconfig ident support. 2002-08-12 00:27:10 +00:00
steve aca1dcf848 Add missing Log and Ident strings. 2002-08-11 23:47:04 +00:00
steve d24cd015b6 Remove VVM option. 2002-08-11 23:39:33 +00:00
steve 4d41525a91 No longer any nead for -rdynamic flag 2002-08-10 22:36:59 +00:00
steve b170a85fef Kill links to vvm. 2002-08-10 22:27:13 +00:00
steve 90c6bc3a61 Add attributes documentation. 2002-08-10 22:27:00 +00:00
steve a4f6217a2f Missing symbols for mingw. 2002-08-10 22:23:22 +00:00
steve faff19af7b vvp.pdf comes from the man page. 2002-08-10 22:12:01 +00:00
steve bc86bd4efa Remove useless error messages. 2002-08-10 22:07:38 +00:00
steve b4b18f3f30 Observe attributes to control synthesis. 2002-08-10 22:07:08 +00:00
steve 1bcacf06d4 The default attribute value is 1. 2002-08-10 21:59:39 +00:00
steve 27178cedda Allow vpiIntegerVar as parameter to $value$plusarg 2002-08-10 17:00:31 +00:00
steve 6151d796a2 More unsupported items in the list. 2002-08-10 16:57:27 +00:00
steve 6ace9659e0 Get local StringHeap.h 2002-08-07 02:36:10 +00:00
steve 14942b4b43 Dead code. 2002-08-07 02:17:14 +00:00
steve 9ede67ea63 List net delays as unsupported. 2002-08-07 02:07:12 +00:00
steve cc74d2a6b0 Add force to nets. 2002-08-07 00:54:39 +00:00
steve ea779ac7dd Documentation, and excessive inlines. 2002-08-07 00:54:20 +00:00
steve 693e9e5ad0 Store only the base name of memories. 2002-08-05 04:18:45 +00:00
steve a1bc8ca6ca Snapshot 20020804 2002-08-04 22:47:23 +00:00
steve 4e753a2c15 dll uses StringHeap for named items. 2002-08-04 19:13:16 +00:00
steve 89314d4772 Do not use hierarchical names of memories to
generate vvp labels. -tdll target does not
 used hierarchical name string to look up the
 memory objects in the design.
2002-08-04 18:28:14 +00:00
steve 41f7ecacfc Eliminate use of ivl_signal_name for signal labels. 2002-08-03 22:30:48 +00:00
steve dd8da912f5 Fix suffix parsing of library index. 2002-08-03 22:30:00 +00:00
steve 65ad911a2a Grammer fixes. 2002-08-02 01:52:02 +00:00
steve 37331d1c1b Add port name to pin size error message. 2002-07-31 23:55:38 +00:00
steve db2c842d15 Account for the tail readonly callbacks. 2002-07-31 03:22:44 +00:00
steve c0e22a6533 Set vpi_mode_flag to represent cpReadOnlySync actions. 2002-07-31 03:22:23 +00:00
steve bb87c368b8 Asynchronous synthesis of sequential blocks. 2002-07-29 00:00:28 +00:00
steve 76665b9404 Fix NetBlock destructor to delete substatements. 2002-07-28 23:58:44 +00:00
steve a265ba2162 dump NOT gates. 2002-07-28 23:57:22 +00:00
steve 461a0fa2fb $attribute deprecation note. 2002-07-26 02:08:02 +00:00
steve e51bbcb85a Add monitoron and monitoroff system tasks. 2002-07-25 03:35:51 +00:00
steve 58ec62c895 Rewrite find_similar_event to support doing
all event matching and replacement in one
 shot, saving time in the scans.
2002-07-24 16:24:45 +00:00
steve 843e1f9c44 Save event matching for nodangle. 2002-07-24 16:22:59 +00:00
steve 45382144c3 Verbose messages. 2002-07-24 16:21:52 +00:00
steve e2f537628f integral type/ptrdiff_t warning. 2002-07-23 15:11:41 +00:00
steve 91baa938e2 Fix display of no arguments. 2002-07-23 02:41:15 +00:00
steve 7fcaeacd65 Careful not to overrun vector buffer. 2002-07-23 02:36:34 +00:00
steve 2478d6f5d3 Set ivl_target delays for case compare logic. 2002-07-22 21:07:40 +00:00
steve fbc1f6fb81 Initialize the lcounter_ to 0. 2002-07-22 21:07:08 +00:00
steve 57aee7ca26 Add vpi_chk_error and vpi_control functions. 2002-07-19 01:57:26 +00:00
steve 2fcfe9f2c3 vpi_iterate returns 0 on error. 2002-07-19 01:12:50 +00:00
steve 2df2619029 Support put of wide vpiVectorVal to signal. 2002-07-19 00:36:36 +00:00
steve 9260d0d245 New e-mail address for Yasuhisa Kato 2002-07-18 02:18:30 +00:00
steve 15becdaee4 Need driver for sure in assign feedback and other cases. 2002-07-18 02:06:37 +00:00
steve 80c9db3c88 Careful with assign to self. 2002-07-18 00:24:22 +00:00
steve c5d03d3a25 Fix uninitialized thread pointer in named event. 2002-07-17 18:30:01 +00:00
steve 9e1570dc80 Implementation of vpi_handle_by_name, and
add the vpiVariables iterator.
2002-07-17 05:13:43 +00:00
steve 68da84e84a Allow wide rvalues assigned to narrow nex_out. 2002-07-16 04:40:48 +00:00
steve 18ba73382e Fix check for select size. 2002-07-16 03:15:11 +00:00
steve dabbfdb80a Fix dangling pointer in pop_scope. 2002-07-15 03:57:30 +00:00
steve 4eea8720a0 Improve temporary file name guess. 2002-07-15 00:33:50 +00:00
steve 41239078a9 Fix initialization of symbol table string heap. 2002-07-15 00:21:42 +00:00
steve e375078dda Infinite loop in nex_input of NetBlock objects. 2002-07-14 23:47:58 +00:00
steve da6b4c447f No longer need the .exe on generated files. 2002-07-14 23:32:31 +00:00
steve b72c0a0089 Do temp file creation by hand. 2002-07-14 23:11:35 +00:00
steve fbaf8f91bb Fix vpiScope iterator. 2002-07-14 02:52:05 +00:00
steve 329e943e4e Use result buf for event and scope names. 2002-07-12 18:23:30 +00:00
steve 31bd3e6056 Use all bits of ?: condit expression. 2002-07-12 18:10:45 +00:00
steve 15b94050ce Remember to scan IntegerVars. 2002-07-12 17:09:21 +00:00
steve c610699227 Eliminate use of vpiInternalScope. 2002-07-12 17:08:13 +00:00
steve f0d2e20342 Scan scope objects before subscopes. 2002-07-12 17:02:38 +00:00
steve 26a80005d6 Fix typo. 2002-07-12 16:30:44 +00:00
steve 5cf033a6ad Remove vvm files from spec file. 2002-07-12 04:05:50 +00:00
steve e41ee7632d Document the IVERILOG_DUMPER variable. 2002-07-12 02:35:35 +00:00
steve 66a86433e7 Make types array static, not on stack. 2002-07-12 02:10:20 +00:00
steve 2354a90e9f Eliminate use of vpiInternalScope. 2002-07-12 02:08:10 +00:00
steve b7aaf51fbd vpiIntegerVars can have callbacks. 2002-07-12 02:07:36 +00:00
steve 5a885165b2 vpi_iterate return null if there is nothing to iterate. 2002-07-12 02:04:44 +00:00
steve a748604418 Library dir case insensitivity includes the suffix. 2002-07-10 04:34:18 +00:00
steve e1a4e27173 Dynamic resizevpi result buf in more places. 2002-07-09 03:24:37 +00:00
steve 2b06a293b6 Fix split of root btree node. 2002-07-09 03:20:51 +00:00
steve 472f98affe Generate code for wide muxes. 2002-07-08 04:04:07 +00:00
steve 8114523be2 Asynchronous synthesis of case statements. 2002-07-07 22:32:15 +00:00
steve 33ee1da817 Smart synthesis of binary AND expressions. 2002-07-07 22:31:39 +00:00
steve 301040a67a Avoid emitting to vvp local net symbols. 2002-07-05 21:26:17 +00:00
steve 54b96ea7bd Count different types of functors. 2002-07-05 20:08:44 +00:00
steve d0dfe2e7e7 Allow set of output name. 2002-07-05 17:17:20 +00:00
steve fd8ceac170 Names of vpi objects allocated as vpip_strings. 2002-07-05 17:14:15 +00:00
steve a05d8c2823 Symbol table uses more efficient key string allocator,
and remove all the symbol tables after compile is done.
2002-07-05 04:40:59 +00:00
steve 626f418ab0 Track opcode memory space. 2002-07-05 03:46:43 +00:00
steve 5792220dcb Remove the vpi object symbol table after compile. 2002-07-05 02:50:57 +00:00
steve 29d5d44f03 More detailed Mac OS X instructions. 2002-07-04 16:37:59 +00:00
steve b2762f63a2 Fix s_vpi_vecval array byte size. 2002-07-04 16:37:07 +00:00
steve 7d97f8a964 initial statements are not asynchronous. 2002-07-04 00:24:16 +00:00
steve d3e63088d8 Dynamic size result buffer for _str and _get_value functions. 2002-07-03 23:39:57 +00:00
steve dddaa0ebcf More configure information in iverilog-vpi. 2002-07-03 23:20:12 +00:00
steve ccbb1e5f5a don't pollute name space
fix vecval for Z/X cases
2002-07-03 23:16:27 +00:00
steve 3f1cd14f6c Fix scope search for events. 2002-07-03 05:34:59 +00:00
steve 70abb2ce5c Clear drive cache on link or unlink. 2002-07-03 03:08:47 +00:00
steve 3f80bead1b vpiName, vpiFullName support in memory types,
length checks for *_get_str() buffers,
 temporary buffers for *_get_str() data,
 dynamic storage for vpi_get_data() in memory types
 shared with signal white space
2002-07-03 02:09:38 +00:00
steve 93bb4283b8 Change the signal to a net when assignments go away. 2002-07-02 03:02:57 +00:00
steve 5b5b31286b Include synth2 in synthesis targets. 2002-07-02 03:02:02 +00:00
steve c5bde6560c Limit word writing to vector limits. 2002-07-01 15:36:12 +00:00
steve cb4eb6236c Ignore generated pdf and ps files. 2002-07-01 03:54:08 +00:00
steve d5e9e13555 synth_asych of if/else requires redirecting the target
if sub-statements. Use NetNet objects to manage the
 situation.
2002-07-01 00:54:21 +00:00
steve 3595b6d186 Carry can propagate to the otp in addi. 2002-07-01 00:52:47 +00:00
steve 210010a390 Get vpiVectorVal for memories. 2002-06-30 04:35:47 +00:00
steve 99b3cc4464 vpiVectorVal of very wide signals. 2002-06-30 02:52:36 +00:00
steve 9b6b081e38 Add structure for asynchronous logic synthesis. 2002-06-30 02:21:31 +00:00
steve b54ee3b1cd Fix mishandling of incorect defparam error message. 2002-06-25 02:39:34 +00:00
steve 9fc4e1eddd Cache calculated driven value. 2002-06-25 01:33:22 +00:00
steve 73cca6ec39 include malloc.h only when available. 2002-06-25 01:33:01 +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 6dd80611a1 Export ivl_signal_integer fro windows. 2002-06-23 20:41:19 +00:00
steve c2132039d2 Variable substitution in command files. 2002-06-23 20:10:51 +00:00
steve d8d07eb129 trivial performance boost. 2002-06-23 18:23:09 +00:00
steve f9768cd579 spelling error. 2002-06-23 18:22:43 +00:00
steve b6a15b2f4d Wide unary minus in continuous assignments. 2002-06-22 04:22:40 +00:00
steve 5eca5d9948 Carry integerness throughout the compilation. 2002-06-21 04:59:35 +00:00
steve f4a4ee00d0 Add support for special integer vectors. 2002-06-21 04:58:55 +00:00
steve cd94019733 Remove NetTmp and add NetSubnet class. 2002-06-19 04:20:03 +00:00
steve d7fb47268f Shuffle link_drivers_constant for speed. 2002-06-19 04:18:46 +00:00
steve b4b5ac9944 Normalize run-time index expressions for bit selects 2002-06-16 20:39:12 +00:00
steve df0b81d94d Generate runtime code to normalize indices. 2002-06-16 19:19:16 +00:00
steve 067d09720c Rounding error. 2002-06-15 02:35:49 +00:00
steve 870c35eece sign extend signed vectors vpiIntVal. 2002-06-14 22:05:28 +00:00
steve a82c178fd9 Fix expression width for repeat concatenations. 2002-06-14 21:38:41 +00:00
steve 809bd18e66 Uninstall removed ivl from libdir. 2002-06-14 04:17:12 +00:00
steve 4f0ffa2258 Compiler portability. 2002-06-14 03:25:51 +00:00
steve f45b17973c Add acc_fetch_argc/argv/version (mruff) 2002-06-11 15:19:12 +00:00
steve 0bbea355c2 More specify syntax. 2002-06-11 13:58:04 +00:00
steve 2be3507422 Stub value change callbacks for consts and modules. 2002-06-11 03:47:34 +00:00
steve d6c946f390 Spelling patch (Larry Doolittle) 2002-06-11 03:34:33 +00:00
steve 96b6eb6b30 Get tf_asynchon/off name right. 2002-06-11 03:29:14 +00:00
steve 9cef973d9b Add NetRamDq synthsesis from memory l-values. 2002-06-08 23:42:46 +00:00
steve 88722a2831 Add tf_putlongp and tf_putp. 2002-06-07 16:21:12 +00:00
steve d6b5c67313 Add a bunch of acc/tf functions. (mruff) 2002-06-07 02:58:58 +00:00
steve 4fed9d6532 Simply give up on constants with indices. 2002-06-07 02:57:54 +00:00
steve 28e0616543 Use standard name for iostream. 2002-06-06 18:57:18 +00:00
steve 6173e6b78a Better error for identifier index eval. 2002-06-06 18:57:04 +00:00
steve b5018cd994 distclean rm some generated makefiles. 2002-06-06 18:48:02 +00:00
steve f19a7c617d improved uninstall target. 2002-06-05 18:52:14 +00:00
steve 53d8cdd9f8 Add support for memory words in l-value of
non-blocking assignments, and remove the special
 NetAssignMem_ and NetAssignMemNB classes.
2002-06-05 03:44:25 +00:00
steve 4bac5c06ba Dump l-value memory indices. 2002-06-05 03:43:14 +00:00
steve 91a755d0e8 Add support for memory words in l-value of
blocking assignments, and remove the special
 NetAssignMem class.
2002-06-04 05:38:43 +00:00
steve 8cae7a4d44 Add misctf support to libveriuser 2002-06-04 01:42:58 +00:00
steve 11d1c45e45 Add asynchon and asynchoff 2002-06-04 01:40:03 +00:00
steve 5454a15b94 Fix return type of tf_getinstance. 2002-06-03 21:52:59 +00:00
steve 3ad0ec77ce Add verinum != operator. 2002-06-03 04:04:24 +00:00
steve 3966e852ac Ignore memories and named events. 2002-06-03 03:56:06 +00:00
steve 83bfa9345f compile warnings. 2002-06-03 03:55:14 +00:00
steve 7d1d3847d8 Better typing for veriusertfs table. 2002-06-03 00:08:42 +00:00
steve a91c4f66ce Check for null pointers from users. 2002-06-02 19:05:50 +00:00
steve ca2486ea61 Add acc_handle_tfarg and acc_next_topmode 2002-06-02 19:03:29 +00:00
steve 24a2487c18 Generate %cmpi/u where appropriate. 2002-06-02 18:57:17 +00:00
steve d68153dea3 Add %cmpi/u instruction. 2002-06-02 18:55:58 +00:00
steve 89329fc0cc Add tf_getinstance function. 2002-06-02 18:54:59 +00:00
steve cba5a22714 Generate %muli instructions when possible. 2002-05-31 20:04:57 +00:00
steve 1ce50993f0 Add the %muli instruction. 2002-05-31 20:04:22 +00:00
steve 2c0c934ad5 Add tf_getlongtime (mruff) 2002-05-31 18:25:51 +00:00
steve b6db8b63ec Check for and don't dereference null pointers,
Avoid copy of static objects.
 (mruff)
2002-05-31 18:21:39 +00:00
steve f1ab9e63fa Add support for $timeformat. 2002-05-31 04:26:54 +00:00
steve 12c574d5c9 Call padding reserved. 2002-05-31 04:26:44 +00:00
steve af6f0c800f Slight improvement in %mov performance. 2002-05-31 04:09:58 +00:00
steve 48f65cef40 Word oriented bit storage. 2002-05-31 00:05:49 +00:00
steve b5a1d116fa Add the veriusertf_register funciton. 2002-05-30 02:37:26 +00:00
steve b9339d3c60 Add tf_nump from mruff. 2002-05-30 02:12:17 +00:00
steve 0838dd24a4 Add tf_error and tf_warning from mruff 2002-05-30 02:10:08 +00:00
steve 9537fd7f0b Implement acc_product_version. 2002-05-30 02:06:05 +00:00
steve 95876feb46 Use addi with wide immediate values. 2002-05-30 01:57:23 +00:00
steve 19d817503d Offset lvalue index expressions. 2002-05-29 22:05:54 +00:00
steve b6b364a09d Add %addi, which is faster to simulate. 2002-05-29 16:29:34 +00:00
steve f704d4d3ff Use binary search to speed up deep lookups. 2002-05-29 05:37:35 +00:00
steve 450b9ab85c Callbacks can happen during calltf functions. 2002-05-28 22:55:20 +00:00
steve a1774bd3bd ivl indexes the search path for libraries, and
supports case insensitive module-to-file lookup.
2002-05-28 20:46:51 +00:00
steve 5aa69516bb ivl indexes the search path for libraries, and
supports case insensitive module-to-file lookup.
2002-05-28 20:40:37 +00:00
steve c594dcec52 Add new iverilog-vpi man page. 2002-05-28 05:21:30 +00:00
steve 8126384726 ignore generated iverilog-vpi files. 2002-05-28 05:21:13 +00:00
steve 96e6a9b02f Update to new capabilities. 2002-05-28 05:20:41 +00:00
steve d44ff4fd91 Pass library paths through -Cfile instead of command line. 2002-05-28 02:25:03 +00:00
steve 9a4ee873e1 Add the ivl -C flag for bulk configuration
from the driver, and use that to run library
 modules through the preprocessor.
2002-05-28 00:50:39 +00:00
steve 597ed1681a Predefine __ICARUS__ 2002-05-27 23:14:06 +00:00
steve bcd49b94dd Able to disable thread self. 2002-05-27 00:53:10 +00:00
steve 422754f36f Support carrying the scope of named begin-end
blocks down to the code generator, and have
 the vvp code generator use that to support disable.
2002-05-27 00:08:45 +00:00
steve bfad382fd1 Carry Verilog 2001 attributes with processes,
all the way through to the ivl_target API.

 Divide signal reference counts between rval
 and lval references.
2002-05-26 01:39:02 +00:00
steve 8941a594ee include iostream for gcc 3.1 2002-05-25 16:51:37 +00:00
steve 6bd8ab46d5 Eval ^ and &0 expressions. 2002-05-25 16:43:47 +00:00
steve 57f2ad6d15 Better padding of constants. 2002-05-25 16:43:22 +00:00
steve 33efeca0da Only match plusargs. 2002-05-24 21:46:21 +00:00
steve be1888ed5f Implement mc_scan_plusargs. 2002-05-24 20:29:07 +00:00
steve 6ede18d41c support GCC __attributes__ for printf formats. 2002-05-24 19:05:30 +00:00
steve d63e994ea5 Detect long division by zero. 2002-05-24 04:55:13 +00:00
steve 700887d657 Verilog 2001 attriubtes on nets/wires. 2002-05-24 04:36:23 +00:00
steve 42674be38b Support language generation flag -g. 2002-05-24 01:13:00 +00:00
steve fde7cd8f10 Add support for $bits (SystemVerilog) 2002-05-24 00:44:54 +00:00
steve 7ce713356e Define SIZEOF_UNSIGNED_LONG_LONG 2002-05-24 00:43:16 +00:00
steve 6511fc610b Add the acc_user.h header file. 2002-05-23 03:46:42 +00:00
steve 8dd4f77f3f Add the io_printf function to libveriuser. 2002-05-23 03:35:42 +00:00
steve 004bfad348 Link the veriuser library. 2002-05-23 03:35:05 +00:00
steve ff90a5735d Export the vpi_vprintf function. 2002-05-23 03:34:46 +00:00
steve e6c0629626 Add language support for Verilog-2001 attribute
syntax. Hook this support into existing $attribute
 handling, and add number and void value types.

 Add to the ivl_target API new functions for access
 of complex attributes attached to gates.
2002-05-23 03:08:50 +00:00
steve 01efffedfc Ignore Named events in vcd signal scan. 2002-05-23 01:07:26 +00:00
steve 74c219f171 Add ranges and signed to port list declarations. 2002-05-20 02:06:01 +00:00
steve bf10c5762a Parse port_declaration_lists from the 2001 Standard. 2002-05-19 23:37:28 +00:00
steve ca9abaf0c5 Start the libveriuser library. 2002-05-19 05:21:00 +00:00
steve cfab250671 Add callbacks for vpiNamedEvent objects. 2002-05-19 05:18:16 +00:00
steve b1c0f7306d Add vpi support for named events.
Add vpi_mode_flag to track the mode of the
 vpi engine. This is for error checking.
2002-05-18 02:34:11 +00:00
steve a156d8b8ce Add vpiIndex update. 2002-05-17 16:13:08 +00:00
steve a7b7781fe9 Rewire vpiMemory and vpiMemoryWord handles to
support proper iteration of words, and the
 vpiIndex value.
2002-05-17 04:12:19 +00:00
steve 21fe6afe8d null terminate the reversed decimal string 2002-05-17 04:05:38 +00:00
steve 48da46986b Support set by string for reg objects. 2002-05-15 04:48:46 +00:00
steve 8d6239301f Count compile errors. 2002-05-15 01:25:25 +00:00
steve 2e6807493f Make clean should remove iverilog-vpi. 2002-05-15 01:25:07 +00:00
steve 94cef20e49 task calls and forks push the thread event in the queue. 2002-05-12 23:44:41 +00:00
steve c787a36af2 Accept errors in memory index expression. 2002-05-12 19:16:58 +00:00
steve da0c4c7565 Get thread vectors by vpiIntVal. 2002-05-12 00:32:21 +00:00
steve 9c28f085d8 Set and get memory words by string value. 2002-05-11 04:39:35 +00:00
steve e9af0c7485 Support scope iterate over vpiNet,vpiReg/vpiMemory. 2002-05-10 16:00:57 +00:00
steve be54bfdc21 ignore vpiMemory objects in vcd dumper. 2002-05-10 16:00:16 +00:00
steve c6a6f4bc79 Allow for C++ source files. 2002-05-10 03:54:46 +00:00
steve 88ae1b7b3c Handle null time and calltf pointers. 2002-05-09 03:34:31 +00:00
steve f5d3b78653 Use else clause instead of ! to preface wait events. 2002-05-07 05:06:07 +00:00
steve 68f1316eba Fix uninitialized memory accesses. 2002-05-07 04:15:43 +00:00
steve e70e04d6e8 Handle x case of unary ! properly. 2002-05-07 03:49:58 +00:00
steve a3eb6868ea Allow parameters in concatenation of widths are defined. 2002-05-06 02:30:27 +00:00
steve 186759c95e Do not need mangle.o unless vvm us used. 2002-05-06 00:50:38 +00:00
steve 8667b9a35d Put off evaluation of concatenation repeat expresions
until after parameters are defined. This allows parms
 to be used in repeat expresions.

 Add the builtin $signed system function.
2002-05-05 21:11:49 +00:00
steve 00defb0265 Credit for Mike Ruff amd Mike Runyan. 2002-05-04 03:19:35 +00:00
steve 822a085d97 Properly free vpi callback objects. 2002-05-04 03:17:29 +00:00
steve f23aec7f14 Add simulator event callbacks. 2002-05-04 03:03:17 +00:00
steve fb457128bf Add vpiModule iterator to vpiScope objects. 2002-05-03 15:44:11 +00:00
steve d126a414bd Spelling errors. 2002-04-30 04:26:42 +00:00
steve 844fe3b9bc Trim leading nulls from string forms. 2002-04-27 23:26:24 +00:00
steve 271855377f Support drawing vpiBinaryConst in hex. 2002-04-27 22:36:39 +00:00
steve 84020b16e3 Preserve stringiness string part select and concatenation. 2002-04-27 05:03:46 +00:00
steve c6035ab06e If the verinum is already right, no need to reset it. 2002-04-27 04:49:27 +00:00
steve d94a40ecd9 Display string verinums as strings. 2002-04-27 04:48:43 +00:00
steve c3be17ccae Dump parametres for system functions. 2002-04-27 04:20:52 +00:00
steve 10dc978778 Fixup eval of signed constants. 2002-04-27 03:17:15 +00:00
steve 7f8f0eb65a Support selecting bits from parameters. 2002-04-27 02:38:04 +00:00
steve c7107dc973 Evaluate constant bit select of constants. 2002-04-25 05:04:31 +00:00
steve 74eb544962 Dump bit select expressions. 2002-04-25 05:03:11 +00:00
steve 0696e3d558 Agressively evalutate case expressions. 2002-04-24 17:40:48 +00:00
steve 714ca3542d Fix compile time eval of signed <= signed. 2002-04-24 02:47:02 +00:00
steve 7e27217dac add -Wno- arguments to the driver. 2002-04-24 02:02:31 +00:00
steve 4a7e14786c Tail size was wrong. 2002-04-23 05:18:05 +00:00
steve 1ddb736f4c Handle bitsel muxes of odd shaped outputs. 2002-04-23 05:06:31 +00:00
steve 9ef49379f4 Add support for non-constant bit select. 2002-04-23 03:53:59 +00:00
steve 96213fe0ac Keep delays applied to BUFZ devices. 2002-04-22 03:15:25 +00:00
steve d482da4803 Reduce the while loop expression if needed. 2002-04-22 02:41:30 +00:00
steve 4502da608d Dump the while loop expression. 2002-04-22 02:40:32 +00:00
steve 0976fd393b Do not allow implicit wires in sensitivity lists. 2002-04-22 00:53:39 +00:00
steve 5882c6a481 Redo handling of assignment internal delays.
Leave it possible for them to be calculated
 at run time.
2002-04-21 22:31:02 +00:00
steve 52ea13819a Add the assign/d instruction for computed delays. 2002-04-21 22:29:49 +00:00
steve 048d044fdc Functions really do work. 2002-04-21 22:29:19 +00:00
steve 9dda15a186 implement nex_input for behavioral statements. 2002-04-21 17:43:12 +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 eb708c1540 Support specified times in cbReadOnlySync, and
add support for cbReadWriteSync.
 Keep simulation time in a 64bit number.
2002-04-20 04:33:23 +00:00
steve 47a3b1f744 the command is gtkwave. 2002-04-20 02:42:58 +00:00
steve 76b5d7e9e1 Fix first_file test for timescale warning. 2002-04-18 18:38:37 +00:00
steve 0071c9b0aa More examples. 2002-04-18 03:25:16 +00:00
steve 0ab42597d9 Timescale warnings. 2002-04-15 00:04:22 +00:00
steve 95ccc1e904 lexor support for huge decimal numbers. 2002-04-14 21:42:01 +00:00
steve ea44866b2f Evaluate logical not at elaboration time. 2002-04-14 21:16:48 +00:00
steve 6d4c6b56f6 Fix constant evaluation of unary 2002-04-14 19:28:47 +00:00
steve f03ec88c2a Handle empty true case of conditional statements. 2002-04-14 19:19:21 +00:00
steve e630ecdb0d Ternary expressions can be signed. 2002-04-14 19:02:34 +00:00
steve eb27dc8db3 Support signed integer division. 2002-04-14 18:41:34 +00:00
steve 5cf7355c91 Precalculate unary - if possible. 2002-04-14 03:55:25 +00:00
steve 84bf0cee59 Vector constants to vpi_call can have sign. 2002-04-14 03:54:40 +00:00
steve a18662ed13 Allow signed constant vectors for call_vpi parameters. 2002-04-14 03:53:20 +00:00
steve 3275d1f252 Support signed expressions through to VPI. 2002-04-14 02:56:19 +00:00
steve b14a0b885a Fix bug removing pairs of ones in XOR. 2002-04-14 02:51:37 +00:00
steve e95a902b3d Show unary subexpressions. 2002-04-14 02:44:53 +00:00
steve 6733f7625b Detect missing indices to memories (PR#421) 2002-04-13 02:33:17 +00:00
steve f7f61a8696 Detect mismatches in reg as module items and ports. 2002-04-12 02:57:08 +00:00
steve e1a6bb10de Formally define extended arguments to vvp. 2002-04-12 02:44:02 +00:00
steve 07bee5ca72 Add $plusargs system functions. 2002-04-07 04:37:53 +00:00
steve fa97ba0d9a Set vpip_cur_task while calling compileft 2002-04-07 02:34:10 +00:00
steve bc95b02854 make install for iverilog-vpi 2002-04-07 00:50:13 +00:00
steve 1893e7c8e5 Add the iverilog-vpi command. 2002-04-07 00:47:10 +00:00
steve 0c04e2976b minor cleanup of formatting. 2002-04-07 00:46:21 +00:00
steve ac4fbb3e41 allow runtime selection of VCD vs LXT. 2002-04-06 21:33:29 +00:00
steve c98c24b9ff cbValueChange automatically replays. 2002-04-06 20:25:45 +00:00
steve 284c6fd85d Add dependency generation. 2002-04-04 05:26:13 +00:00
steve 3c8551ce90 Update for gcc 3.0 2002-03-31 04:07:40 +00:00
steve 65159a2733 Update for newer bison. 2002-03-31 04:06:49 +00:00
steve 007d702223 Notes about scheduling 2002-03-31 01:54:13 +00:00
steve 362b2aa604 vpip_bits_to_dec_str takes a bit array in a specific format. 2002-03-18 05:33:24 +00:00
steve de252965ac Add the .ufunc statement. 2002-03-18 00:19:34 +00:00
steve 7349a6beaf Generate port information in the .ufunc statement. 2002-03-18 00:18:50 +00:00
steve 828ca0ef9d Add API to support user defined function. 2002-03-17 19:30:20 +00:00
steve f5049c2f14 Do not push values through logic gates. 2002-03-17 05:48:49 +00:00
steve f77c7f3d18 Clean up edge detection code. 2002-03-17 03:24:34 +00:00
steve f75fb3cd95 Force the push flags to be explicit. 2002-03-17 03:23:10 +00:00
steve 8b9c26598a Patch to allow user to set place for temporary files. 2002-03-15 23:27:42 +00:00
steve 53600d3361 Pass the %f flag for the -tpal target. 2002-03-09 22:31:48 +00:00
steve 0dc5e5e29d Add LXT dumper support. (Anthony Bybell) 2002-03-09 21:54:48 +00:00
steve eae9153b40 Parse multiline definitions. 2002-03-09 06:37:49 +00:00
steve 3d646aa92c Constant expressions are not l-values for task ports. 2002-03-09 04:02:26 +00:00
steve b7c2bd4f72 Add the NetUserFunc netlist node. 2002-03-09 02:10:22 +00:00
steve b0a489fb7f Debug code for write to constants. 2002-03-08 05:41:45 +00:00
steve 01b9d5e023 Better linker error messages. 2002-03-05 05:31:52 +00:00
steve 6fa9415482 Initialize all the codes tables. 2002-03-01 05:43:59 +00:00
steve c159ff3134 Add cleanup to verbose messages. 2002-03-01 05:43:14 +00:00
steve efa5338e3b out-of-memory asserts. 2002-03-01 05:42:50 +00:00
steve 6dcf880482 carriage return is white space. 2002-02-27 05:46:33 +00:00
steve b5fbb82ba1 Make vvm optional, normally off. 2002-02-16 03:18:53 +00:00
steve ba8465abd2 Support pragma comments. 2002-02-15 05:20:58 +00:00
steve 0964dd99c5 Add writememb (Tom Verbeure) 2002-02-06 04:50:22 +00:00
steve a6a78f5776 Detect and skip suppressed values in display 2002-02-06 04:50:04 +00:00
steve 23f73390a4 support x and z in memory word binary values. 2002-02-06 04:49:24 +00:00
steve d55a890fdd get bin or hex string values of memory words. 2002-02-06 04:48:34 +00:00
steve 84de8f2b93 Add fpga.tgt to the file list. 2002-02-04 01:31:02 +00:00
steve 08dac488c1 Release 0.6 updates. 2002-02-04 00:48:30 +00:00
steve f2cff31b6e Clean up warnings. 2002-02-04 00:41:34 +00:00
steve 7c3f5c9fae Support print of version number. 2002-02-03 07:05:36 +00:00
steve aa16e82102 Fix parameter bit select check for magic constants. 2002-02-03 05:53:00 +00:00
steve ddd3566d50 Add CVS tokens. 2002-02-03 05:51:31 +00:00
steve ec82af0c74 Use Larrys bits-to-decimal-string code. 2002-02-03 01:01:51 +00:00
steve 78bb3d6f09 Comments about xor evaluation. 2002-02-03 00:06:28 +00:00
steve 54dab22042 event find_similar should not find self. 2002-02-02 06:13:38 +00:00
steve 9756cb6382 Propagate sign in unary minus. 2002-02-01 05:09:14 +00:00
steve 9fa0f95003 Full support for $readmem ranges (Tom Verbeure) 2002-01-31 04:28:17 +00:00
steve a624021a2e Detect duplicate port declarations. 2002-01-31 04:10:15 +00:00
steve 928df5caf7 include config.h to eliminate warnings. 2002-01-29 22:36:31 +00:00
steve 5796524f06 Add ne_expr.cc 2002-01-28 01:39:45 +00:00
steve b761a105b3 release candidate 0.6 2002-01-28 01:33:54 +00:00
steve 364ffc9024 Add support for bit select of parameters.
This leads to a NetESelect node and the
 vvp code generator to support that.
2002-01-28 00:52:41 +00:00
steve 712080f7e0 Detect scalar/vector declarion mismatch. 2002-01-26 05:28:28 +00:00
steve b906f4c0a1 Handle x in l-value of set/x 2002-01-26 02:08:07 +00:00
steve d48bb4d744 Tell check target where to find system.vpi. 2002-01-25 03:25:16 +00:00
steve d67ad166cd Support display of strings with umber formats. (Tom Verbeure) 2002-01-25 03:24:19 +00:00
steve 4e286ea86b Add the vpiLeft.. and vpiRightRange constants 2002-01-24 04:19:39 +00:00
steve a9be4e009f Spelling in comment. 2002-01-24 04:17:46 +00:00
steve 2f05d4b227 bison 1.31 doesnot include stdio.h 2002-01-24 03:57:45 +00:00
steve 0b68639f7d elaborate deassign lval as done for assign. 2002-01-23 05:56:22 +00:00
steve 5f09e01a44 No implicit declaration in assign l-values. 2002-01-23 05:23:17 +00:00
steve 6a98764b3b Load modules with RTLD_LAZY 2002-01-23 04:54:37 +00:00
steve 853c1f4387 Detect incorrect function ports. 2002-01-23 03:35:17 +00:00
steve b99c5aa394 Update for 0.6 release 2002-01-23 02:43:14 +00:00
steve 349be0f169 Precalculate constant results of memory index expressions. 2002-01-22 01:40:04 +00:00
steve 4f28f6a770 Better calcuation of dec string width (Larry Doolittle) 2002-01-22 00:18:10 +00:00
steve fcf64c0c38 More space efficient use of constant strings (Larry Doolittle) 2002-01-22 00:06:56 +00:00
steve da8d59757e return calculated oval from UDP (Stephan Boettcher) 2002-01-20 23:27:51 +00:00
steve a02cfe0f1b Evaluate case guards, if possible. 2002-01-19 20:09:56 +00:00
steve f3255121a2 Spelling fixes. 2002-01-19 19:22:39 +00:00
steve 608555ce7e Pass back target errors processing conditionals. 2002-01-19 19:02:08 +00:00
steve ec8b6e126e Default widths pad out as per the standard,
add $displayb/o/h et al., and some better
 error messages for incorrect formats.
2002-01-15 03:23:34 +00:00
steve a697157257 Support DesSTrVal for binary constants. 2002-01-15 03:21:18 +00:00
steve ec070ee65b Support vpiSize and vpiSigned for time objects. 2002-01-15 03:06:29 +00:00
steve 02f5ccd5d9 Handle constants with drive strength z 2002-01-12 17:49:41 +00:00
steve 361d4f2147 Drive strengths for continuous assignments. 2002-01-12 04:03:39 +00:00
steve c09a148cd9 Make BUFZ device strengths available. 2002-01-12 04:03:09 +00:00
steve b274dada85 Support the BUFZ logic device. 2002-01-12 04:02:16 +00:00
steve c6a937e2e7 The stime system function is 32bits. 2002-01-11 05:25:45 +00:00
steve 5840368f2d Handle certain special cases of stime. 2002-01-11 05:23:05 +00:00
steve dee52dd2d0 Magic stime object support. 2002-01-11 05:21:47 +00:00
steve a0e3b3386d Add the stime system function. 2002-01-11 05:20:59 +00:00
steve 6535b48c1c Add the %c format, and some warning messages. 2002-01-11 04:48:01 +00:00
steve 4d3611c5f1 odd width thread vectors as strings. 2002-01-10 01:54:04 +00:00
steve 77c4c88a4c String prints of non-round vectors (PR378) 2002-01-09 03:29:12 +00:00
steve 4291866b9f Add vpi_get_vlog_info support. 2002-01-09 03:15:23 +00:00
steve 8aef782411 Make lexor_keyword.cc for distributions. 2002-01-07 04:59:21 +00:00
steve 0aa033ddf3 Support scope for functors. (Stephan Boettcher) 2002-01-06 17:50:50 +00:00
steve edba542c7a Feedback output, not propagated output. (Stephan Boettcher) 2002-01-06 17:35:01 +00:00
steve 0e5289b022 Print a useful message for failed include file. 2002-01-06 04:51:31 +00:00
steve 6be3be0f16 Constant values have drive strengths. 2002-01-06 03:15:43 +00:00
steve 03d188fc52 Support weak functor inputs. 2002-01-06 03:15:13 +00:00
steve 6e1e658922 VPI access to root module scopes. 2002-01-06 00:48:39 +00:00
steve a87575a76e make check uses vvp instead of vvm. 2002-01-05 04:36:43 +00:00
steve 336624c7b9 include malloc.h only when available. 2002-01-05 04:36:06 +00:00
steve 71660fbaa5 Implement vpi_mcd_printf. 2002-01-04 02:26:36 +00:00
steve dd79885f6d Add structural modulus support down to vvp. 2002-01-03 04:19:01 +00:00
steve 51ffeb7c06 Use my own cfltype to defend against bison 1.30. 2002-01-02 02:39:34 +00:00
steve 912749342c Parse combinational event delay. 2001-12-31 05:23:13 +00:00
steve 4bb91c4f98 Elaborate multiply nets with constant operands ad NetConst. 2001-12-31 04:23:59 +00:00
steve 400580179f Get sense of 1-bit == operator right. 2001-12-31 01:56:08 +00:00
steve c9d6b5431d Remove test print 2001-12-31 00:39:20 +00:00
steve 51db00fb44 Support $signed cast of expressions. 2001-12-31 00:08:14 +00:00
steve e20acfc9f9 Include s indicator in dump of signed numbers. 2001-12-31 00:02:33 +00:00
steve a3fe753826 Account for negatives in cmp/s 2001-12-31 00:01:16 +00:00
steve 03aebd7525 Support elaborate_net for PEString objects. 2001-12-30 21:32:03 +00:00
steve fd5c0cfa28 Support vpiStringVal in vhtread vectors. 2001-12-30 21:31:38 +00:00
steve 357a0ff23e Detect bison and flex in configure.in 2001-12-30 17:20:33 +00:00
steve 1a22f37d92 Synthesize reduction logic. 2001-12-30 17:06:52 +00:00
steve a5890b914f Properly handle empty target in positionla parameter override. 2001-12-30 04:47:57 +00:00
steve b397b10104 Evaluate constant unary minus. 2001-12-30 00:39:25 +00:00
steve 5de8e0555c push events through event/or lists. 2001-12-29 23:59:06 +00:00
steve 91b01cd67e constant eval of arithmetic with x and z. 2001-12-29 22:10:10 +00:00
steve 9c6b17c887 Allow escaped $ in identifiers. 2001-12-29 20:41:30 +00:00
steve 000d187c94 Do not delete delay expressions of UDP instances. 2001-12-29 20:19:31 +00:00
steve 989e9d4d94 Newline can terminate escaped names. 2001-12-29 19:00:13 +00:00
steve 40ef704cc3 Evaluate constant right shifts. 2001-12-29 00:43:55 +00:00
steve 7c9fe0c173 clarify bufif output strenghts. 2001-12-19 23:43:03 +00:00
steve dddbeb957a Comments about MUX synthesis. 2001-12-18 05:34:02 +00:00
steve fd0cb30a4d Improved functor debug dumps. 2001-12-18 05:32:11 +00:00
steve 125c631091 Remove result length restrictions for vpi_get_value. 2001-12-18 05:31:54 +00:00
steve 443dc7853f Include config.h for namespace declaration. 2001-12-18 04:52:45 +00:00
steve a5400d7212 Support all 3 TRI net types. 2001-12-15 02:13:33 +00:00
steve da09d4c6e6 The IVL_SIT_WIRE type does not exist, it is a
synonym for IVL_SIT_TRI.
2001-12-15 02:13:17 +00:00
steve ace6b0a767 Give tri0 and tri1 their proper strengths. 2001-12-15 02:11:51 +00:00
steve 7d494fd3d5 Support tri0 and tri1 resolvers. 2001-12-15 01:54:38 +00:00
steve cd1524e6ca Generate notif functors. 2001-12-14 06:03:34 +00:00
steve a0526cdd32 Arrange bufif to support notif as well. 2001-12-14 06:03:17 +00:00
steve 4dd5f97a96 Parse and handle drive strengths of gates to vvp. 2001-12-14 02:05:13 +00:00
steve 1ca6fe5519 Support strength syntax on functors. 2001-12-14 02:04:49 +00:00
steve 6b2c604124 Better variable names for functor chunks. 2001-12-14 01:59:28 +00:00
steve e42775ea7f support toupper and tolower of file names. 2001-12-08 04:13:07 +00:00
steve a8c4729cf5 vpi_put_value of vpiIntVal for memory words. 2001-12-07 23:23:05 +00:00
steve c200c0c20e Support integer for function return value. 2001-12-07 05:03:13 +00:00
steve 4b174fd996 Forgot to evaluate UDP delays. 2001-12-06 05:04:49 +00:00
steve dbf5509f4f Support delays on UDP instances. 2001-12-06 04:44:11 +00:00
steve ec4f8c80d5 Support functor delays for gates and UDP devices.
(Stephan Boettcher)
2001-12-06 03:31:24 +00:00
steve c8319bcc02 Add ivl_logic_delay function to ivl_target. 2001-12-06 03:11:00 +00:00
steve 7bf480be9a Some bison versions choose different output names. 2001-12-06 02:55:24 +00:00
steve 2d3e85d941 Make sure fork labels are globally unique. 2001-12-05 05:41:20 +00:00
steve ab6c8cb4b8 Parser and pform use hierarchical names as hname_t
objects instead of encoded strings.
2001-12-03 04:47:14 +00:00
steve 33c7c47f73 Handle index identifiers in simple paths. 2001-12-01 02:42:39 +00:00
steve 64d7b1cee5 Support addresses in readmemh. 2001-12-01 02:40:10 +00:00
steve 0cebef872a Better synthesys of DFF w/ complex l-values. (Larry Doolittle) 2001-11-30 01:22:21 +00:00
steve 65f835f3eb Properly parse net_decl assignments with delays. 2001-11-29 17:37:51 +00:00
steve 8309c1f673 Preserve the text after ifdefs in the output. 2001-11-29 02:26:25 +00:00
steve e85347bf8b Handle part selects in l-values of DFF devices. 2001-11-29 01:58:18 +00:00
steve 86a4512848 Restore -Fxnfio to -txnf target. 2001-11-29 01:06:51 +00:00
steve 82831ea9a5 Use NetScope instead of string for scope path. 2001-11-22 06:20:59 +00:00
steve 98c145c3b6 Ignore foo and a.out. 2001-11-22 06:20:32 +00:00
steve a50fe36ef8 Ignore foo and a.out. 2001-11-22 04:44:23 +00:00
steve 7cbd710f7b Remove diag print. 2001-11-21 02:59:27 +00:00
steve 39ef2b7605 Pass list of file to ivlpp via temporary file. 2001-11-21 02:20:34 +00:00
steve da4901bb17 Close library files after parsing. 2001-11-20 23:36:34 +00:00
steve f28f5e01e5 Unary reduction operators are all 1-bit results. 2001-11-19 04:26:46 +00:00
steve e00aedd99b Handle padding out of logical values. 2001-11-19 04:25:46 +00:00
steve 9d1a81ce2c Handle division and modulus by zero while
evaluating run-time constants.
2001-11-19 02:54:12 +00:00
steve cfed3933fa Port close cropping behavior from mcrgb
Move window array reset to libmc.
2001-11-19 01:54:14 +00:00
steve 659624c71f Print typename is fallback expression node dump. 2001-11-19 01:46:38 +00:00
steve 6e0b77a8da Generate force code for variable l-values. 2001-11-18 01:28:18 +00:00
steve 54bb59ae99 Support compile on MacosX 10.1.1 (Timothy J. Wood) 2001-11-17 17:57:58 +00:00
steve cac941b272 More spelling. 2001-11-17 17:45:37 +00:00
steve 0be48388c2 Add support for +libext+ in command files. 2001-11-16 05:07:19 +00:00
steve d8970752b6 include stdlib.h for portability. 2001-11-16 04:22:27 +00:00
steve 08f0f5a1f7 DLL target support for force and release. 2001-11-14 03:28:49 +00:00
steve f8162be8c3 Describe +incdir and +define. 2001-11-14 03:28:15 +00:00
steve f50074de50 The +incdir+ plusarg can take multiple directores,
and add initial support for +define+ in the command file.
2001-11-13 03:30:26 +00:00
steve 9866fd01bd Support +incdir in command files, and ignore other
+args flags. Also ignore -a and -v flags.
2001-11-12 18:47:32 +00:00
steve d1ad10c90f More sophisticated command file parser. 2001-11-12 01:26:36 +00:00
steve 0045d7d1bf Remov XNF dead wood. 2001-11-11 00:10:05 +00:00
steve 4a74ae1795 Runtime support for functor delays. (Stephan Boettcher) 2001-11-10 18:07:11 +00:00
steve 4d0b840c26 Coerse input to inout when assigned to. 2001-11-10 02:08:49 +00:00
steve 0c7335a77d Spelling errors. 2001-11-09 03:43:26 +00:00
steve 7e8a538c20 Support $writememh 2001-11-09 03:39:21 +00:00
steve aca5afa95c Support vpiIntVal from memory. 2001-11-09 03:39:07 +00:00
steve 7793a49854 Remove string paths from PExpr elaboration. 2001-11-08 05:15:50 +00:00
steve 6bfbcbdcf7 elaborate_lnet uses scope instead of string path. 2001-11-07 04:26:46 +00:00
steve bf72f39fe9 eval_const uses scope instead of a string path. 2001-11-07 04:01:59 +00:00
steve fa23dafdae Use functor pointers where vvp_ipoint_t is unneeded. 2001-11-07 03:34:41 +00:00
steve 9572ddd7e8 Support more real arithmetic in delay constants. 2001-11-06 06:11:55 +00:00
steve 1ff36dc892 shift expressions can have definite widths. 2001-11-06 04:32:37 +00:00
steve bf9a8f5021 Code rearrange. (Stephan Boettcher) 2001-11-06 03:07:21 +00:00
steve 0c4bea473c Parse specparam parsepulse assignments. 2001-11-06 02:52:19 +00:00
steve 649428962e Pad limited r-values in continuous assignments. 2001-11-04 23:12:29 +00:00
steve cc5ddc0b6b MacOSX 10.1 updates. 2001-11-04 05:03:21 +00:00
steve b624b6002e Parse more [gosh darn] specify syntax. 2001-11-03 04:09:10 +00:00
steve af35736e04 initialize scope for %m in $fdisplay. 2001-11-02 05:56:47 +00:00
steve 58b5b583a7 Comment the scope type parser. 2001-11-02 05:43:11 +00:00
steve 9e385e6947 Implement split_node for symbol table (hendrik) 2001-11-02 04:48:03 +00:00
steve 560c003e03 make fork label into complete statemnt. 2001-11-01 19:31:40 +00:00
steve 1d045eea0d Catch ports that have no direction. 2001-11-01 05:21:26 +00:00
steve 7a0e73ef3d Handle procedural constant functor pointers. 2001-11-01 04:42:39 +00:00
steve 5d20dd63ec Generate code for deassign and cassign. 2001-11-01 04:26:57 +00:00
steve ab9a853d52 ivl_target support for cassign. 2001-11-01 04:25:31 +00:00
steve 82c0a2ebac Add force/cassign/release/deassign support. (Stephan Boettcher) 2001-11-01 03:00:19 +00:00
steve 75e78e86d3 ivl_target support for assign/deassign. 2001-10-31 05:24:52 +00:00
steve a75326e2e0 Rewrite the functor type to have fewer functor modes,
and use objects to manage the different types.
 (Stephan Boettcher)
2001-10-31 04:27:46 +00:00
steve b3e430c751 Give up if roots are missing. 2001-10-31 03:22:31 +00:00
steve faa3a62259 detect module ports not declared within the module. 2001-10-31 03:11:15 +00:00
steve 438605fad5 Account for new scope type syntax on scope. 2001-10-31 03:07:11 +00:00
steve 9505b586bf Generate IEEE1364-2000 line directives. 2001-10-30 21:53:27 +00:00
steve 40e7bc2450 line number in line directive is for the *next* line. 2001-10-30 21:46:56 +00:00
steve a9aaca1ffa Add ifndef support. 2001-10-30 20:48:55 +00:00
steve ce61d12f60 Stubs for assign/deassign for t-dll. 2001-10-30 02:52:07 +00:00
steve 874bab10e4 NetObj constructor finally requires a scope. 2001-10-28 01:14:53 +00:00
steve 21194c909a Propagate functor push, to make assign better. 2001-10-27 03:43:56 +00:00
steve 96a50d635d Minor rework of summation carry propagation (Stephan Boettcher) 2001-10-27 03:22:26 +00:00
steve 8c9e0bafa9 more specify syntax (Stehpan Boettcher) 2001-10-26 03:22:56 +00:00
steve b3bb79992a const/non-const warnings. (Stephan Boettcher) 2001-10-26 02:29:10 +00:00
steve 4e92501864 VPI support for callback to return values. 2001-10-25 04:19:53 +00:00
steve d83fb10774 The ! expression returns 0 to x and z values. 2001-10-24 05:06:54 +00:00
steve 5a6cca33a0 Write resolvers before the .functor (PR#300) 2001-10-24 03:43:45 +00:00
steve b2f6953259 npmos outputs have 3bit strengths, not 2. 2001-10-24 03:18:52 +00:00
steve b1f1f74920 Support bit selects of non-0 lsb for vectors. 2001-10-23 04:22:41 +00:00
steve 2adea8de48 Fix carry between works for %add instruction. 2001-10-23 03:49:13 +00:00
steve 859318becd The -s flag can now be repeated on the iverilog command. 2001-10-23 00:37:29 +00:00
steve 55fb219503 document the -y flag. 2001-10-23 00:36:54 +00:00
steve b01316ce12 Better error message for mising root module. 2001-10-22 23:26:37 +00:00
steve 1921e19635 fix constant overrun in | operands. 2001-10-22 15:31:21 +00:00
steve 990df42407 Handle activating tasks in another root. 2001-10-22 02:05:20 +00:00
steve 924b4e0062 unused idx warning. 2001-10-22 02:04:37 +00:00
steve 0e43dfb285 Remove useless code for drawing .var inputs. 2001-10-22 00:04:51 +00:00
steve 46621d3c83 wrong variable for clk input to memory. 2001-10-21 23:38:16 +00:00
steve fa95f7ff3b Kill const-nonconst warning. 2001-10-21 23:37:49 +00:00
steve e45546e6f3 Install pdf version of the man pages. 2001-10-21 21:59:49 +00:00
steve d79d48ffeb clean up API for restarting parser. 2001-10-21 20:18:56 +00:00
steve 467ecf5b33 Error messages for missing UDP port declarations. 2001-10-21 01:55:24 +00:00
steve 9f3e64e11a Module types in pform are char* instead of string. 2001-10-21 00:42:47 +00:00
steve 56954356db Catch and X division by 0. 2001-10-20 23:20:32 +00:00
steve 6466d02eda Add automatic module libraries. 2001-10-20 23:02:39 +00:00
steve 7a149a6943 Scope/module names are char* instead of string. 2001-10-20 05:21:51 +00:00
steve acf3a4ec16 Print memory usage information if requested (Stephan Boettcher) 2001-10-20 01:03:42 +00:00
steve 5c4b87675f Evaluate constant == when operands differ in width. 2001-10-20 00:11:24 +00:00
steve 83d3a60d5c Add trailing ; to fork-join out labels. 2001-10-19 23:52:36 +00:00
steve 3e4eb17b15 Another go at getting link of ivl.exe right. 2001-10-19 23:15:01 +00:00
steve 1075b28f26 export the ivl_design_roots function. 2001-10-19 23:14:46 +00:00
steve 943527c526 Fix memory fault with -c flag. 2001-10-19 23:10:08 +00:00
steve d350620315 Support multiple root modules (Philip Blundell) 2001-10-19 21:53:24 +00:00
steve 6fc556cefc Method to get the type_ member 2001-10-19 01:55:32 +00:00
steve 73283768a5 Support rnpmos devices. (Philip Blundell) 2001-10-18 17:30:25 +00:00
steve ce7d64f427 Evaluate string expressions (Philip Blundell) 2001-10-18 16:41:49 +00:00
steve 84b70be7ee Include HAVE_SYS_WAIT in config.h (PR#306) 2001-10-18 16:16:23 +00:00
steve 3924c51097 Support vpiVectorVal for signals. (Philip Blundell) 2001-10-18 04:52:31 +00:00
steve 4bb1bd4315 Get Division error into the division method! 2001-10-16 03:10:20 +00:00
steve 0164ad78be Catch division by zero in .arith/div. 2001-10-16 03:06:18 +00:00
steve 36e1eab3f4 Add arith/div object. 2001-10-16 02:47:37 +00:00
steve 177fa4062b Support IVL_LPM_DIVIDE for structural divide. 2001-10-16 02:19:26 +00:00
steve 821c68696d Generate %div instructions for binary /. 2001-10-16 01:27:17 +00:00
steve a3217db7b2 Add %div support (Anthony Bybell) 2001-10-16 01:26:54 +00:00
steve 42dab181cd Carry the type of the scope (Stephan Boettcher) 2001-10-15 02:58:27 +00:00
steve 98d71de50f sign warning. 2001-10-15 02:55:03 +00:00
steve c596e1cda1 Include scope information in VCD output. 2001-10-15 01:50:23 +00:00
steve 706f2ffc89 Support getting scope of scope, and scope of signals. 2001-10-15 01:49:50 +00:00
steve a7054a91e5 libiberty is needed for mingw, and useable under cygwin. 2001-10-14 19:54:05 +00:00
steve ad44b411fb Try appending .vpi to module names with directories. 2001-10-14 18:42:46 +00:00
steve f7fa2f1f4d More coverage of $dump related commands. 2001-10-14 18:32:06 +00:00
steve 2fcab15704 Forgot to propagate carry. 2001-10-14 17:36:18 +00:00
steve cfbad49d33 Very wide multiplication (Anthony Bybell) 2001-10-14 16:36:43 +00:00
steve 9dbcb32808 vvm support for pullup/down gates (PR#288) 2001-10-14 03:50:53 +00:00
steve 1b69bb5d2f Handle mode-42 functor init. 2001-10-14 03:41:58 +00:00
steve 2326672b3a Handle constant bits in arithmetic expressions. 2001-10-14 03:24:35 +00:00
steve 393a76d57a threshold of $width is optional. 2001-10-14 02:03:51 +00:00
steve 4b3b41cd79 Propogate strength-only changes from resolver. 2001-10-14 01:45:11 +00:00
steve eab5793dda Account for non-0 start address for memories (Stephan Boettcher) 2001-10-14 01:36:12 +00:00
steve 6cf2ddf541 M42 implementation of mode 2 (Stephan Boettcher) 2001-10-12 03:00:08 +00:00
steve ad6bbe539f functor lookup includes vpi signal search. 2001-10-12 02:53:47 +00:00
steve f12864f69e Propagate initial value of UDP. 2001-10-11 18:29:21 +00:00
steve b61c89c104 npmos devices pass strength. 2001-10-11 18:20:51 +00:00
steve 0def3c9983 Initialize attributes for bufz devices. 2001-10-11 00:13:19 +00:00
steve 9e5dc17c1d Detect execv failures. 2001-10-11 00:12:49 +00:00
steve 36d36d99f3 Generate BUF devices for bufz logic. 2001-10-11 00:12:28 +00:00
steve de985ac3fd Document the behavioral reduction or. 2001-10-10 04:48:12 +00:00
steve 245905aeda Support vectors as operands to logical and. 2001-10-10 04:47:43 +00:00
steve ac6caaf29e More make install details. 2001-10-09 23:05:10 +00:00
steve 3734b5e7f1 spec reference events can be identifiers. 2001-10-09 18:11:58 +00:00
steve 789efb9832 Collect functor reference handling into a single function. (Stephan Boettcher) 2001-10-09 16:57:47 +00:00
steve c7bc35ad75 get CFLAGS from configure 2001-10-09 16:50:17 +00:00
steve 5071ce8575 handle nmos and pmos devices. 2001-10-09 02:28:44 +00:00
steve 64ff74df37 Add the PMOS and NMOS functor types. 2001-10-09 02:28:16 +00:00
steve 181066311b Tasks can have sub-scopes. 2001-10-09 02:01:04 +00:00
steve 20ad433f8c Fix pr283: signal values before enddefinitions in vcd. (Stephan Boettcher) 2001-10-08 23:33:00 +00:00
steve 494b5ff1ee parameter names do not have defined size. 2001-10-07 03:38:08 +00:00
steve cbd501b865 Fix some Cygwin DLL handling. (Venkat Iyer) 2001-09-30 16:45:10 +00:00
steve 41384a0e41 Reduce VCD output by removing duplicates. (Stephan Boettcher) 2001-09-30 05:18:46 +00:00
steve 3854e12024 Fencepost error in memory writes. (Stephan Boettcher) 2001-09-29 20:55:42 +00:00
steve ff55af1e9e Check address is in range for set. (Stephan Boettcher) 2001-09-29 04:45:20 +00:00
steve bdf643ddb1 Generate code for unary minus (PR#272) 2001-09-29 04:37:44 +00:00
steve d46465845c Fix the size of unsized constant operants to compare (PR#274) 2001-09-29 01:53:22 +00:00
steve dd75595082 Handle short l-values to concatenation. 2001-09-20 03:46:38 +00:00
steve a73cfbc2b5 MacOS X compile time changes. (Timothy Wood) 2001-09-20 03:21:01 +00:00
steve 21c844363a Change UDP output only if table matches. 2001-09-19 04:10:40 +00:00
steve 3109906514 Detect C name mangling for dlsym. 2001-09-17 22:26:33 +00:00
steve 606eb2b3cd Support the cellref attribute. 2001-09-16 22:26:47 +00:00
steve e99059e001 Support attributes to logic gates. 2001-09-16 22:19:42 +00:00
steve cefbb635c1 Suppor the PAD attribute on signals. 2001-09-16 01:48:16 +00:00
steve b2b8b89cd8 Make configure detect malloc.h 2001-09-15 18:27:04 +00:00
steve 92760f2c5f Support != in virtex code generator. 2001-09-15 05:06:04 +00:00
steve 176be94be9 dead code. 2001-09-14 04:20:49 +00:00
steve 9fda809fa6 Add XOR and XNOR gates. 2001-09-14 04:17:20 +00:00
steve 3c8d598eed Elaborate == to NetCompare instead of XNOR and AND
gates. This allows code generators to generate
 better code in certain cases.
2001-09-14 04:16:52 +00:00
steve f2068e83d4 Generate code for identity comparators. 2001-09-14 04:15:46 +00:00
steve 5976e7078c Xilinx uses GROUND and VCC as pin names for the
GND and VCC devices.

 Connect the top end of the EQ chain to the MUXCY
 instead of to the LUT. The MUXCY has the real output.
2001-09-12 04:35:25 +00:00
steve da9a84ed84 Use carry mux to implement wide identity compare,
Place property item in correct place in LUT cell list.
2001-09-11 05:52:31 +00:00
steve 03b635604a initial structural memory propagation (Stephan Boettcher) 2001-09-11 01:54:58 +00:00
steve 167f94bdbf Add 4 wide identity compare. 2001-09-10 03:48:34 +00:00
steve 4507351d48 Virtex support for mux devices and adders
with carry chains. Also, make Virtex specific
 implementations of primitive logic.
2001-09-09 22:23:28 +00:00
steve 0253f92e7e pin down some enumerated constants. 2001-09-09 22:21:57 +00:00
steve 432d4efc9b Connect right ANEB pin when doing NE comparator. 2001-09-09 16:49:04 +00:00
steve 749c3eb5a7 No code for unlinked constants. 2001-09-08 01:23:21 +00:00
steve e933b56507 extend xz from the top character, not the second-from-top. 2001-09-08 01:22:55 +00:00
steve 0c5ce9dfec Redo of_SUBU in a more obvious algorithm, that
is not significantly slower. Also, clean up the
 implementation of %mov from a constant.

 Fix initial clearing of vector by vector_to_array
2001-09-07 23:29:28 +00:00
steve acde444439 Separate the virtex and generic-edif code generators. 2001-09-06 04:28:39 +00:00
steve 298a352cbd Add documentation for the code generator. 2001-09-02 23:58:49 +00:00
steve 356552faad Add virtex support for some basic logic, the DFF
and constant signals.
2001-09-02 23:53:55 +00:00
steve 5e1e79b3c4 Rearrange the XNF code generator to be generic-xnf
so that non-XNF code generation is also possible.

 Start into the virtex EDIF output driver.
2001-09-02 21:33:07 +00:00
steve 2996d2eb19 Generic ADD code. 2001-09-01 04:30:44 +00:00
steve 16023cbbd6 Generate code for MUX devices. 2001-09-01 02:28:42 +00:00
steve 77927972e5 identity compare, and PWR records for constants. 2001-09-01 02:01:30 +00:00
steve d762a320dc Make constants available through the design root 2001-09-01 01:57:31 +00:00
steve a9e54e7553 dead comments. 2001-09-01 00:58:16 +00:00
steve 8b8a3d83e0 Relax pin count restriction on logic gates. 2001-08-31 23:02:13 +00:00
steve 3fbbd4080a synthesize the special case of compare with 0. 2001-08-31 22:59:48 +00:00
steve e79a371f76 Support DFF CE inputs. 2001-08-31 22:58:39 +00:00
steve c507379f09 Handle more path polarity cases. 2001-08-31 21:08:35 +00:00
steve 47031767fa Parse $setuphold statements. 2001-08-31 17:38:41 +00:00
steve af5e68448c Add the fpga target. 2001-08-31 17:28:10 +00:00
steve c1c88f87c6 Many more logic gate types. 2001-08-31 04:17:56 +00:00
steve a9b5c9c037 Add root port SIG records. 2001-08-31 02:59:06 +00:00
steve 03b428b6cb Handle update in place of repeat constants. 2001-08-31 01:37:56 +00:00
steve 271a835305 Bind escaped names with non-escaped equivilents. (PR#256) 2001-08-30 22:40:12 +00:00
steve a3c3019a04 Mangle nexus names. 2001-08-30 04:31:04 +00:00
steve f063bf833f Add the fpga target. 2001-08-28 04:14:20 +00:00
steve 2002c03cef Add some ivl_target convenience functions. 2001-08-28 04:07:17 +00:00
steve b8be5e80cd Generate code for l-value bit selects. 2001-08-26 23:00:13 +00:00
steve c29e11ed36 Add the assign/x0 and set/x opcodes. 2001-08-26 22:59:32 +00:00
steve e35ed6e91c Change the NetAssign_ class to refer to the signal
instead of link into the netlist. This is faster
 and uses less space. Make the NetAssignNB carry
 the delays instead of the NetAssign_ lval objects.

 Change the vvp code generator to support multiple
 l-values, i.e. concatenations of part selects.
2001-08-25 23:50:02 +00:00
steve 794ce68a6c Only use fvectors for nets and vars. 2001-08-25 17:22:32 +00:00
steve 31aa85ce7d Handle wide assignment to narrow return value. 2001-08-23 02:54:15 +00:00
steve 15c2b0317d statement ends after while loop labels. 2001-08-16 03:45:17 +00:00
steve 820d8b9edc Support various other string formats for time. 2001-08-16 03:29:31 +00:00
steve a3a0f5f432 Add some missing print escape sequences. 2001-08-16 03:26:04 +00:00
steve a98b5023a8 Describe the new .net behavior. 2001-08-10 04:31:27 +00:00
steve 645c8913f1 Neaten and document the resolv object. 2001-08-10 04:31:09 +00:00
steve 066284d5c2 Make sure arithmetic objects run at time 0. 2001-08-10 00:50:50 +00:00
steve 2802601c44 tgt-vvp generates code that skips nets as inputs. 2001-08-10 00:40:45 +00:00
steve 962a77c6b8 Rearrange bison parameters for portability. 2001-08-10 00:39:22 +00:00
steve ca801574e3 Include functor address in debug functor print. 2001-08-09 22:25:30 +00:00
steve 606c1d38bb Nets (wires) do not use their own functors.
Modifications to propagation of values.
 (Stephan Boettcher)
2001-08-09 19:38:23 +00:00
steve 147ee59940 memory port bug fix. 2001-08-09 19:37:05 +00:00
steve 2e3fc89831 rearrange bison parameters for compatability. 2001-08-09 19:35:29 +00:00
steve 82bccd335d Initial implementation of vvp_fvectors.
(Stephan Boettcher)
2001-08-08 01:05:06 +00:00
steve bfc05e2d71 Unused variable warnings. 2001-08-08 00:57:20 +00:00
steve c8135595be signed/unsigned warnings? 2001-08-08 00:53:50 +00:00
steve d5658d4180 dosify compiled with mingw does not know cygwin paths. 2001-08-05 17:28:40 +00:00
steve 8356e6a51f Properly synthesize part selects. 2001-08-05 02:49:07 +00:00
steve fbf55b9df4 Get the hello.vl and sqrt.vl names right. 2001-08-04 05:53:44 +00:00
steve 176e6d09ca Add install of examples for Windows. 2001-08-03 17:06:47 +00:00
steve b72d1c297d More detailed messages about unsupported things. 2001-08-03 17:06:10 +00:00
steve f5b9c26735 Detect system function used as a task. 2001-08-03 06:50:44 +00:00
steve d8141252e9 Accept empty port lists to module instantiation. 2001-08-01 05:17:31 +00:00
steve ed86dee65d Initialize initial functor tables. 2001-07-30 03:53:01 +00:00
steve f535cd3077 Add quickstart and mingw.txt to documentation list. 2001-07-30 03:44:48 +00:00
steve 537757a7b9 Cleanup defines and types for mingw compile. 2001-07-30 02:44:05 +00:00
steve 4fb354776e misspell ivl_expr_lsi 2001-07-30 02:43:20 +00:00
steve 1583b1e84a Reference the iverilog man page. 2001-07-29 22:50:44 +00:00
steve 45ff04ecb6 Reference the vvp man page. 2001-07-29 22:50:28 +00:00
steve ef08e43cf2 support local reference to scope in expressions. 2001-07-29 22:22:40 +00:00
steve e17f7f5146 Detect a missing task definition before it crashes me. 2001-07-28 22:13:11 +00:00
steve 8654412844 lsb vs msb in error message. 2001-07-28 22:00:27 +00:00
steve 140533db50 If module name has a /, skip the path search. 2001-07-28 03:29:42 +00:00
steve 00cacae2a3 Generate constant symbols for supply nets. 2001-07-28 03:18:50 +00:00
steve 7e0b0d7328 Support C<su0> and C<su1> special symbols. 2001-07-28 03:12:39 +00:00
steve 1be77d68ce Evaluate part selects when passed to system tasks. 2001-07-28 01:18:07 +00:00
steve c5a5a11b7f Support getting the signal from IVL_EX_SIGNAL expressions. 2001-07-28 01:17:40 +00:00
steve becc7cb56a Handle part select expressions as variants of
NetESignal/IVL_EX_SIGNAL objects, instead of
 creating new and useless temporary signals.
2001-07-27 04:51:44 +00:00
steve 629a02cccf Fix binding of dangling function ports. do not elide them. 2001-07-27 02:41:55 +00:00
steve f28b97ebfd Spelling error 2001-07-27 02:41:28 +00:00
steve c5234e95cd Make the -M flag add module search paths. 2001-07-26 03:13:51 +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 eb08253ed0 UPdate for 0.5 content. 2001-07-25 02:32:11 +00:00
steve 7b79fd98e5 Fast UDP tables (Stephan Boettcher) 2001-07-24 01:44:50 +00:00
steve 6d5fcf5853 Implement string value for signals. 2001-07-24 01:34:56 +00:00
steve bc284ee6d8 supply signals give input values. 2001-07-22 21:31:14 +00:00
steve 260b4166c1 Recognize supply signal types. 2001-07-22 21:30:56 +00:00
steve b59cc5ff6d Update config.sub and config.guess scripts. 2001-07-22 19:50:55 +00:00
steve 5c89fb71ae Handle repeat for concatenation expressions. 2001-07-22 19:33:51 +00:00
steve 3baa8c0445 vvm does not have a stdlog. 2001-07-22 18:19:19 +00:00
steve ce589da58a Support the NetESubSignal expressions in vvp.tgt. 2001-07-22 00:17:49 +00:00
steve 0bb9359c05 ignore config.cache. 2001-07-22 00:17:22 +00:00
steve 54140dadcf Add the load/x instruction for bit selects. 2001-07-22 00:04:50 +00:00
steve 60c22aefeb Add the -h flag for help. (Stephan Boettcher) 2001-07-21 21:18:55 +00:00
steve 69a2331791 Document the -l flag (Stephan Boettcher) 2001-07-21 21:15:51 +00:00
steve 29cfd8ccfe Add a quick-start document. 2001-07-21 04:39:26 +00:00
steve bf67f386de Add the vvp man page. 2001-07-21 04:34:25 +00:00
steve a2f07011c1 Fix blending of ambiguous pairs. 2001-07-21 02:34:39 +00:00
steve 0bd6cf7b6f Fix of_END when a middle thread ends. 2001-07-20 04:57:00 +00:00
steve cd8e491028 Support calculated delays in vvp.tgt. 2001-07-19 04:55:06 +00:00
steve e773ccfe49 Add support for the delayx opcode. 2001-07-19 04:40:55 +00:00
steve 83de770387 Do not connect reg to module outputs. 2001-07-19 03:43:15 +00:00
steve b3a8098506 EOF is the same as resume. 2001-07-19 02:20:55 +00:00
steve 05407f488f Relax driver limit from 64 to forever (Stephan Boettcher) 2001-07-18 02:44:39 +00:00
steve 85d53ebbf4 Handle 0 counts in repeat concatenation. 2001-07-16 20:41:41 +00:00
steve e4139f4819 Schedule instead of propagating UDP output. (Stephan Boettcher) 2001-07-16 19:08:32 +00:00
steve 45c935af45 Cut off scope iteration when depth runs out. 2001-07-16 18:53:16 +00:00
steve cfbfd9ec1d Properly pad unknow values. (Stephan Boettcher) 2001-07-16 18:48:07 +00:00
steve ae209a144f Add a stdlog output for vvp, and vvp options
to direct them around. (Stephan Boettcher.)
2001-07-16 18:40:19 +00:00
steve 64837efac5 Nest resolvers when there are lots of drivers (Stephan Boettcher) 2001-07-16 18:31:49 +00:00
steve 8d73df2b04 Make vvp output executable (Stephan Boettcher) 2001-07-16 18:26:08 +00:00
steve 59117c2e42 dot in escaped identifiers are not scope. (Stephan Boettcher) 2001-07-16 18:20:27 +00:00
steve e23dd57c9d Reshuffle -v and -V flags of ivl. (Stephan Boettcher) 2001-07-16 18:14:56 +00:00
steve 0e20be774e Initialize allocated functors (Stephan Boettcher) 2001-07-16 18:06:01 +00:00
steve c3ae00ae49 Merge sig and old_ival into union to save space. 2001-07-16 17:57:51 +00:00
steve a7328ecce1 Rewire signal callback support for fast lookup. (Stephan Boettcher) 2001-07-13 03:02:34 +00:00
steve 15a952a143 Remove width restriction on subtraction. 2001-07-13 00:38:57 +00:00
steve 3154f07817 compile libvpi.a with PIC flags (Dan McMahill) 2001-07-11 19:32:02 +00:00
steve 4e700bffb8 support postpone of $systask parameters. (Stephan Boettcher) 2001-07-11 04:43:57 +00:00
steve 7b2d4c9ef6 Get endian of vpiIntVal from constants. 2001-07-11 04:40:52 +00:00
steve da828a218f Add support for REadOnlySync and monitors. 2001-07-11 02:27:21 +00:00
steve 13ef84bc35 Manually create the stage-2 callback structure. 2001-07-11 02:22:17 +00:00
steve c7b36322f6 Properly step through wide inputs. (Stephan Boettcher) 2001-07-09 15:38:35 +00:00
steve 8cc89a3a1f Pass parameters to system functions. 2001-07-07 20:20:10 +00:00
steve b8c5aff0cb Generate !== an an inverted === 2001-07-07 04:37:18 +00:00
steve fb0c387b12 Detect and make available to t-dll the right shift. 2001-07-07 03:01:37 +00:00
steve 1628045b55 Generate code for right shift. 2001-07-07 03:01:06 +00:00
steve 608e5a4dbb Add the .shift/r functor. 2001-07-07 02:57:33 +00:00
steve 30787fd49e Put synthesized signals in proper scope. 2001-07-07 01:38:45 +00:00
steve 1e231c3338 Properly initialize unconnected shift inputs. 2001-07-06 05:02:43 +00:00
steve 370549a19a Generate code for structural left shift. 2001-07-06 04:48:04 +00:00
steve 39c39f0162 Add structural left shift (.shift/l) 2001-07-06 04:46:44 +00:00
steve bcaa122fb9 handle left shifter in dll output. 2001-07-04 22:59:25 +00:00
steve 96403de903 Describe .shift behavior. 2001-07-04 22:59:04 +00:00
steve ab5cad18de Relax limit on behavioral subtraction. 2001-07-04 04:57:10 +00:00
steve b1c548a981 Scope-locals use _s instead of _l. 2001-07-04 04:34:06 +00:00
steve 039769dbaf Generate verbuse status messages (Stephan Boettcher) 2001-07-03 04:09:24 +00:00
steve a76d6dc352 Add the -V flag, and some verbose messages. 2001-07-02 01:57:27 +00:00
steve 7eab75ded1 Parse a lot more specify syntax. 2001-07-01 23:44:43 +00:00
steve ef9c7c4a30 Print memory l-values. 2001-07-01 23:44:19 +00:00
steve 4c54e070ed header statements donot necessarily end in a string. 2001-07-01 23:43:58 +00:00
steve 80c609853a export the ivl_design_time_precision function. 2001-07-01 23:43:23 +00:00
steve eeabc7234c Make sure tmp net gets connected to ramdq output 2001-07-01 23:37:48 +00:00
steve 79b740284a Make NetFF constructor take const char* for the name. 2001-07-01 00:27:34 +00:00
steve ab7b353ace support fast programming by only writing the bits
that are listed in the input file.
2001-06-30 23:03:16 +00:00
steve 3b82a15521 reflect new default vvp target type. 2001-06-30 22:59:40 +00:00
steve 97d972ebb3 More details about running Icarus Verilog. 2001-06-30 21:54:16 +00:00
steve 5f5081827d Make the vvp target the default. 2001-06-30 21:53:42 +00:00
steve 6b7b4e700a Detect parameter mismatches. 2001-06-30 21:28:35 +00:00
steve baac893d22 Support non-const right shift (unsigned). 2001-06-30 21:07:26 +00:00
steve d680e594ed typo in CYMODE=EXAMINE-CI string. 2001-06-30 20:11:15 +00:00
steve 42adc49e57 Get include and lib paths right for mingw and vvm. 2001-06-30 04:23:02 +00:00
steve 4a2168b352 Describe the mingw compile. 2001-06-30 01:04:07 +00:00
steve 44d4660fe8 Redo the ivl_root calculator for mingw. 2001-06-30 00:59:24 +00:00
steve 45d4117c02 Handle null parameters to system tasks. 2001-06-29 02:41:05 +00:00
steve ae837a6347 Relax limit on width of structural sum. 2001-06-29 01:20:20 +00:00
steve 426fc18d10 Relax limit on width of structural sum. 2001-06-29 01:20:20 +00:00
steve 2531ed89cd Properly support signal full names. 2001-06-29 00:44:56 +00:00
steve 566d5c9a93 Get a private copy of the object name. 2001-06-29 00:42:39 +00:00
steve a033c331b6 Report line of unsupported cassign. 2001-06-27 18:34:43 +00:00
steve 066b534307 Get include and lib paths from Makefile. 2001-06-27 02:22:26 +00:00
steve 64cabd8074 Give task/function definitions a vpi type object. 2001-06-25 03:12:06 +00:00
steve a0db52c69f More robust about incorrect arguments. 2001-06-25 03:11:41 +00:00
steve 7bbedd1b55 Look up functor return register with tail of name. 2001-06-23 19:53:03 +00:00
steve 0340256b4c Include stdlib.h 2001-06-23 18:41:02 +00:00
steve c4bd8b1463 Generate %shiftl instructions for shift. 2001-06-23 18:40:34 +00:00
steve a2d465804f Add the %shiftl/i0 instruction. 2001-06-23 18:26:26 +00:00
steve 3c5d32637c Only try the readline library if vvp_debus is enabled. 2001-06-23 18:26:12 +00:00
steve c93cb71162 Allow forward references of task scopes. (Stephan Boettcher) 2001-06-23 01:04:07 +00:00
steve c3960f8e6a Support macromodule as module. 2001-06-23 00:31:06 +00:00
steve 96d04bb5a0 Handle short inputs to tasks. (Stephan Boettcher) 2001-06-23 00:30:42 +00:00
steve 1f1bfd0eab Infinitely wide behavioral add. 2001-06-22 00:03:05 +00:00
steve 8cdf51f913 Initialize stmt_cur_ substatements during dll case building. 2001-06-21 23:23:14 +00:00
steve 1f3eedcfd7 Some documentation of callback behavior. 2001-06-21 23:05:08 +00:00
steve 541f269c20 Support cbValueChange callbacks. 2001-06-21 22:54:12 +00:00
steve 68a7ddefd3 Escaped identifiers in behavioral expressions. (Stephan Boettcher) 2001-06-21 04:53:59 +00:00
steve 3961c68928 Add dumpon and dumpoff (Stephan Boettcher) 2001-06-21 04:15:22 +00:00
steve 832b795826 Edit ivl_install_dir only on mingw 2001-06-20 02:25:40 +00:00
steve 7a6be47603 Get va_start arguments in right order. 2001-06-19 14:57:10 +00:00
steve 81536481cc Add structural EEQ gates (Stephan Boettcher) 2001-06-19 03:01:10 +00:00
steve 6e703c5744 RAM_DQ pins are inputs, so connect HiZ to the nexus. 2001-06-18 03:25:20 +00:00
steve 82e8e51736 1. Logic with more than 4 inputs
2. Id and name mangling
  3. A memory leak in draw_net_in_scope()
  (Stephan Boettcher)
2001-06-18 03:10:34 +00:00
steve 905529081d Add the ~& reduction operator. 2001-06-18 01:54:49 +00:00
steve 4159c98c58 More behavioral unary reduction operators.
(Stephan Boettcher)
2001-06-18 01:09:32 +00:00
steve e40efec4bd Add more UDP edge types, and finish up compile
and run-time support. (Stephan Boettcher)
2001-06-18 00:51:23 +00:00
steve e418625457 export memory symbols in Windows. 2001-06-17 23:55:00 +00:00
steve 4b82d26f5e Add support for structural multiply in t-dll.
Add code generators and vvp support for both
 structural and behavioral multiply.
2001-06-16 23:45:05 +00:00
steve 63a02d1c0a Relax width restriction for structural comparators. 2001-06-16 03:36:03 +00:00
steve bf42772995 Generate code to support memory access in continuous
assignment statements. (Stephan Boettcher)
2001-06-16 02:41:41 +00:00
steve b75221e9bf Fix library path calculation on non Windows systems
to include the install directories. (Brendan Simon)
2001-06-15 05:14:21 +00:00
steve 1e9a54d134 iberty library only needed on Windows 2001-06-15 05:05:04 +00:00
steve ff0b59ff6b support LE and LT comparators. 2001-06-15 05:01:09 +00:00
steve b3a5a0e5ab Generate vvp code for GT and GE comparisons. 2001-06-15 04:14:18 +00:00
steve e002b1c1c4 Add .cmp statements for structural comparison. 2001-06-15 04:07:57 +00:00
steve 7009dc8d9b Change the VPI call process so that loaded .vpi modules
use a function table instead of implicit binding.
2001-06-15 03:28:30 +00:00
steve e28b7f06c5 update documentation to describe vpi in vvp. 2001-06-12 23:32:49 +00:00
steve b6e1d63cb0 Change the VPI call process so that loaded .vpi modules
use a function table instead of implicit binding.
2001-06-12 03:53:10 +00:00
steve 5a279dbdc8 Instructions can forward reference functors. 2001-06-10 17:12:51 +00:00
steve 3ad3a2ab57 support scan of scope from VPI. 2001-06-10 16:47:49 +00:00
steve 5361efe8ed Account for carry out on add devices. 2001-06-07 04:20:10 +00:00
steve 2f2657b765 support subtraction in tgt-vvp. 2001-06-07 03:09:37 +00:00
steve 19a7f3faeb Implement .arith/sub subtraction. 2001-06-07 03:09:03 +00:00
steve f480943649 Support structural addition. 2001-06-07 02:12:43 +00:00
steve f3019ff5a0 Add structural addition. 2001-06-05 03:05:41 +00:00
steve 33ee5c26b0 Fix the fork example. 2001-06-03 20:36:52 +00:00
steve 1e9184f0f9 Make the bufif0 and bufif1 gates strength aware,
and accurately propagate strengths of outputs.
2001-05-31 04:12:43 +00:00
steve 19251f7a79 Propagate strength-values instead of drive strengths. 2001-05-30 03:02:35 +00:00
steve b79da2c4d6 Detect input and input ports declared as reg. 2001-05-25 02:21:34 +00:00
steve e68ba4c73a Attach noops to case labels. 2001-05-24 04:31:00 +00:00
steve 39ffe91230 Add behavioral modulus. 2001-05-24 04:20:10 +00:00
steve 150fc6f3ee correctly interpret signed decimal values. 2001-05-22 04:08:49 +00:00
steve a7411eb00d Get the initial inputs to functors set at xxxx. 2001-05-22 04:08:16 +00:00
steve 660fd7c1d4 Update the mingw build to not require cygwin files. 2001-05-22 02:14:47 +00:00
steve 53772db66d Document configure details. 2001-05-22 02:07:08 +00:00
steve 93dd08bdf5 Configure diable of ipal. 2001-05-22 02:06:39 +00:00
steve 176d707e0a configure detect exe suffixes. 2001-05-22 02:05:50 +00:00
steve 34dade1b65 Fix WIFEXITED macro. 2001-05-20 18:22:02 +00:00
steve 4e815f8565 local declares if the header is missing. 2001-05-20 18:06:57 +00:00
steve e69a3ed934 declare getopt by hand in mingw32 compile. 2001-05-20 17:34:53 +00:00
steve 77d63aba74 make distclean target. 2001-05-20 17:13:27 +00:00
steve de8c725890 Mingw32 support (Venkat Iyer) 2001-05-20 15:09:39 +00:00
steve d4b2958e50 Deleted wrong time when -Tmax is selected. 2001-05-20 15:03:25 +00:00
steve 8669b372e0 Implement reduction nor. 2001-05-20 01:18:38 +00:00
steve 61991e6367 stub ivl_expr_parms for sfunctions. 2001-05-20 01:06:16 +00:00
steve bdcb813727 Initial support for system functions. 2001-05-20 01:02:55 +00:00
steve e6f1510a40 Make vthread_put_but expand the space if needed. 2001-05-20 00:56:48 +00:00
steve 224af78463 Add support for system function calls. 2001-05-20 00:46:12 +00:00
steve 983bf5cbab include missing externs on vthread_put_bit. 2001-05-20 00:45:43 +00:00
steve 96bcf6eac4 Get bit ordering right when making decimal strings. 2001-05-20 00:40:12 +00:00
steve 0872ad34cf Behavioral ternary operators for vvp. 2001-05-17 04:37:02 +00:00
steve 5aee3b866a do not assert if memory reference is invalid. 2001-05-17 03:35:22 +00:00
steve 3ce86f5664 Make error message include error: prefix. 2001-05-17 03:34:47 +00:00
steve 23e5394fb4 Make sure to get local headers first. 2001-05-17 03:22:18 +00:00
steve be7ac7a2ca Update help message. 2001-05-17 03:14:26 +00:00
steve a616cfd0c2 Update to new LPM API for flip-flops. 2001-05-16 03:55:30 +00:00
steve e85b669307 Add the glossary file. 2001-05-15 15:09:08 +00:00
steve bc6dfeb4a9 Skip the , in module lists. 2001-05-14 00:55:31 +00:00
steve bf96986c38 test width of target with bit size of long. 2001-05-14 00:42:32 +00:00
steve 26cfbb2b7b calculate the output of resolvers. 2001-05-13 21:05:06 +00:00
steve 35fc2a609d ignore make check droppings. 2001-05-13 05:06:25 +00:00
steve f05b13c630 A resolver that understands some simple strengths. 2001-05-12 20:38:06 +00:00
steve 4d8954be4c Fixup the resolver syntax. 2001-05-12 16:34:47 +00:00
steve 1d0a9871c2 Generate resolvers for multiple drivers. 2001-05-12 03:31:01 +00:00
steve 2292751fc3 Make sure LPM devices have drives on outputs. 2001-05-12 03:18:44 +00:00
steve a6524e47e2 Silly copyright typo. 2001-05-12 01:48:57 +00:00
steve 02b9aa9163 No entry breakpoint if debug is compiled out. 2001-05-11 03:26:31 +00:00
steve 754adce4a4 Missing export symbols. 2001-05-11 03:25:55 +00:00
steve f3fdf70b56 Export new ivl_ symbols. 2001-05-11 02:43:38 +00:00
steve 38db6fde0c Help for enable-vvp-debug 2001-05-11 02:10:30 +00:00
steve 4f804577f9 Add the --enable-vvp-debug option to the configure
script of vvp, and detect getopt.h.
2001-05-11 02:06:14 +00:00
steve 44a182d92c VVP support for memories in expressions,
including general support for thread bit
 vectors as system task parameters.
 (Stephan Boettcher)
2001-05-10 00:26:53 +00:00
steve 91d65d0e4e Add the vpi_user strength definitions. 2001-05-10 00:16:00 +00:00
steve a88f030b52 Now that the interactive debugger exists,
there is no use for the output dump.
2001-05-09 04:23:18 +00:00
steve 4537de8120 Implement the .resolv syntax. 2001-05-09 02:53:25 +00:00
steve 100bdedac3 input file for memory test. 2001-05-09 02:48:53 +00:00
steve 914ad85e63 Add ivl and vvp.tgt support for memories in
expressions and l-values. (Stephan Boettcher)
2001-05-08 23:59:33 +00:00
steve b3c2ad0a65 preliminary resolver documentation. 2001-05-08 23:58:43 +00:00
steve 2e12635494 Add to the debugger the ability to view and
break on functors.

 Add strengths to functors at compile time,
 and Make functors pass their strengths as they
 propagate their output.
2001-05-08 23:32:26 +00:00
steve 4325b787c0 more missing API symbols. 2001-05-08 04:13:51 +00:00
steve 4e3c702cc7 sort enumeration values. 2001-05-08 04:13:12 +00:00
steve 213cb1b08a Behavioral code to read memories. (Stephan Boettcher) 2001-05-06 17:54:33 +00:00
steve b7569f4d70 Support memory objects. (Stephan Boettcher) 2001-05-06 17:48:20 +00:00
steve e328cf9fed Add the %ix/get instruction. (Stephan Boettcher) 2001-05-06 17:42:22 +00:00
steve 78af3dbdc0 Regularize the mode-42 functor handling. 2001-05-06 03:51:37 +00:00
steve 372674b4c0 Add the memory.vvp example. 2001-05-06 03:50:26 +00:00
steve 8d0f7e1594 Propagate non-x constant net values. 2001-05-06 00:18:13 +00:00
steve 558fea33fb Generate code that causes the value of a net to be passed
passed through all nets of a nexus.
2001-05-06 00:01:02 +00:00
steve de5930f7d8 Add the beginnings of an interactive debugger. 2001-05-05 23:55:46 +00:00
steve e09a14aa44 Forward the simulation time for every event. 2001-05-05 23:51:49 +00:00
steve d45c7c58df Generate code for the fully general event or. 2001-05-03 04:55:46 +00:00
steve b5e0f46229 Generate null statements for conditional labels. 2001-05-03 04:55:28 +00:00
steve 12229e4826 Fix handling of a mode 1 functor that feeds into a
mode 2 functor. Feed the result only if the event
 is triggered, and do pass to the output even if no
 threads are waiting.
2001-05-03 04:54:33 +00:00
steve 8f88525819 dll build of many probes forgot to index the probe. 2001-05-03 01:52:45 +00:00
steve a225fe304d Document memory related opcodes,
parser uses numbv_s structures instead of the
 symbv_s and a mess of unions,
 Add the %is/sub instruction.
       (Stephan Boettcher)
2001-05-02 23:16:50 +00:00
steve 0f9eb13245 Remove the init parameter of functors, and instead use
the special C<?> symbols to initialize inputs. This is
 clearer and more regular.
2001-05-02 04:05:16 +00:00
steve 06437b7fba Support behavioral subtraction. 2001-05-02 01:57:25 +00:00
steve ba910c0fac Describe a generic event a bit. 2001-05-02 01:38:13 +00:00
steve 28278d3c09 initialize is_schedule. 2001-05-02 01:37:38 +00:00
steve 2bf7653ab9 Implement %ix/load. 2001-05-01 05:00:02 +00:00
steve cb39b3b65c Account for ipoint_input_index behavior in inputs_connect. 2001-05-01 02:18:15 +00:00
steve 3e3757bde7 Comparisons cant leave their results in the opcode
result area or their values will be clobbered by other
 parts of a complex expression.
2001-05-01 02:07:34 +00:00
steve 8b4befd4fc Add support for memory objects. (Stephan Boettcher) 2001-05-01 01:09:39 +00:00
steve 972e9c866b OR is %or. Get this right. 2001-04-30 05:11:18 +00:00
steve f758010f01 Describe constant functor inputs in the symbol section. 2001-04-30 04:51:27 +00:00
steve 8057faccc1 Fix up functor inputs to support C<?> values. 2001-04-30 03:53:19 +00:00
steve 3f952a2fd2 detect multiple drivers on nexa. 2001-04-30 00:00:27 +00:00
steve eb71c70c99 Carry drive strengths in the ivl_nexus_ptr_t, and
handle constant devices in targets.'
2001-04-29 23:17:38 +00:00
steve 2a44cf70b1 Add bufif and pull devices. 2001-04-29 23:16:31 +00:00
steve 431b16639d Add bufif0 and bufif1 functors. 2001-04-29 23:13:33 +00:00
steve 014e68b62f Support .net constant inputs. 2001-04-29 22:59:46 +00:00
steve 31291f5d8a Evalulate logical or (||) 2001-04-29 20:47:39 +00:00
steve a52b34cb64 Add pullup and pulldown devices. 2001-04-29 20:19:10 +00:00
steve 3ca55bf327 Better handling of module item errors. 2001-04-29 20:18:34 +00:00
steve 9bb2cee686 UDP instances need not have user supplied names. 2001-04-28 23:18:08 +00:00
steve 4f3bdd9f38 Accept single strengths for pullup and pulldown. 2001-04-28 22:56:15 +00:00
steve efe41c2435 input connect cleanup. (Stephan Boettcher) 2001-04-28 20:24:03 +00:00
steve f855cb19b8 Excessive header include. 2001-04-28 20:09:05 +00:00
steve 861ed55879 Support marking vvp interpreter (Stephan Boettcher) 2001-04-28 20:06:07 +00:00
steve 35e0dcdd3d More robust parsing of compiler directives. 2001-04-28 18:43:18 +00:00
steve a72a8607e6 New exported symbols for ivl_target API. 2001-04-26 23:33:48 +00:00
steve 904747acf5 Link time references fixed. 2001-04-26 23:32:31 +00:00
steve 4d40a336c0 Look for the strip tool 2001-04-26 23:32:02 +00:00
steve 32e9c8049a Spurious declaration 2001-04-26 16:12:48 +00:00
steve bb24624979 Assure gperf is present. 2001-04-26 16:12:29 +00:00
steve 506bc87e82 Handle missing or uninstalled .conf files. 2001-04-26 16:04:39 +00:00
steve 986885bd70 Add the mode-42 functor concept to UDPs. 2001-04-26 15:52:22 +00:00
steve 73c4893ef7 Implement simple MUXZ for ?: operators. 2001-04-26 05:12:02 +00:00
steve 62c9f39297 Redo and simplify UDP behavior. 2001-04-26 03:10:55 +00:00
steve 8b5f62a5e5 Support $deposit to a wire or reg. 2001-04-26 00:01:33 +00:00
steve aec5841c7f Implement vpi_put_value for signals. 2001-04-25 04:45:52 +00:00
steve c997c090a1 Document the UDP implementation. 2001-04-25 04:35:05 +00:00
steve 0ab60cd3c3 Fix setting StX in vpip_bits_set_value. 2001-04-24 15:47:37 +00:00
steve ae23a8f6bf Fix underflow when UDP has 1 input. 2001-04-24 03:48:53 +00:00
steve 46e868d313 Fix generation of udp/comb definitions. 2001-04-24 02:59:52 +00:00
steve 8dfa322b8b Support for UDP devices in VVP (Stephen Boettcher) 2001-04-24 02:23:58 +00:00
steve 2f2f08b02f Missing symbols. 2001-04-23 00:42:37 +00:00
steve 102fd24dd2 Support unconnected .net objects. 2001-04-23 00:37:58 +00:00
steve 66cf3ec8fa More UDP consolidation from Stephan Boettcher. 2001-04-22 23:09:45 +00:00
steve 57b0d9691e Right shift by constant. 2001-04-21 03:26:23 +00:00
steve 7c6f496765 Add NAND and XNOR functors. 2001-04-21 02:04:01 +00:00
steve 67e72ce77e Left shift by a constant amount. 2001-04-21 01:49:17 +00:00
steve c97692d715 Generate code for disable. 2001-04-21 00:55:46 +00:00
steve 66f83f3b08 Working %disable and reap handling references from scheduler. 2001-04-21 00:34:39 +00:00
steve 3765bdd3ac Spurious assert of empty statemnt. 2001-04-19 03:04:47 +00:00
steve 39bcdfb7b4 Use the new %fork syntax. 2001-04-18 05:12:03 +00:00
steve 57cd770650 %end complete the %join for the parent. 2001-04-18 05:04:19 +00:00
steve 3194b0c53a Resolve forward references for %fork. 2001-04-18 05:03:49 +00:00
steve 9e8005f7b7 Put threads into scopes. 2001-04-18 04:21:23 +00:00
steve 41ce198a1f add XOR support. 2001-04-15 16:37:48 +00:00
steve 05e30ed43b Add support for behavioral xnor. 2001-04-15 04:07:56 +00:00
steve 09cd582cc5 Oops, excessive test assert neets to be removed. 2001-04-15 03:19:44 +00:00
steve 235781ce08 Handle noop as case statements. 2001-04-15 03:14:31 +00:00
steve 70aeb980d8 vvp support for <= with internal delay. 2001-04-15 02:58:11 +00:00
steve d0d6189874 Less picky about ternary operands. 2001-04-14 22:50:39 +00:00
steve 8205d0fcc9 Use event/or for wide anyedge statements. 2001-04-14 05:11:49 +00:00
steve 60d068a33e support the .event/or statement. 2001-04-14 05:10:56 +00:00
steve e1a4b457c2 Initialize the waiting_for_event member. 2001-04-14 05:10:05 +00:00
steve 86e18226eb More complete reap of all threads. 2001-04-13 03:55:18 +00:00
steve 7fa2975c24 Add new symbols for windows. 2001-04-10 17:21:21 +00:00
steve d39190243b Add the disable statemnent. 2001-04-07 19:24:36 +00:00
steve 0550287658 Generate vvp code for functions with ports. 2001-04-06 02:28:02 +00:00
steve 82947a9343 Generate vvp code for the repeat statement. 2001-04-05 03:20:57 +00:00
steve b7fb806611 Generate signed .net and .var statements. 2001-04-05 01:38:24 +00:00
steve 6a236061de Add the .var/s and .net/s statements for VPI support. 2001-04-05 01:34:26 +00:00
steve 898639d7bf Get signed compares working correctly in vvp. 2001-04-05 01:12:27 +00:00
steve 6322400b83 support decimal strings from signals. 2001-04-04 17:43:19 +00:00
steve 9b7341889d Get intval from a binary constant. 2001-04-04 05:07:19 +00:00
steve 0653f859bc Support forever loops in the tgt-vvp target. 2001-04-04 04:50:35 +00:00
steve 48ff66cbce Take vector form as parameters to vpi_call. 2001-04-04 04:33:08 +00:00
steve 1b2a6f8bed Fix broken look scanning down bits of number. 2001-04-04 04:28:41 +00:00
steve c6cf665c4a emit vpi parameters values as vectors. 2001-04-04 04:14:09 +00:00
steve 19c84ff9a2 Support non-blocking assignments. 2001-04-03 04:50:37 +00:00
steve 15398a8f58 VPI access time as a decimal string, and
stub vpi access to the scopes.
2001-04-03 03:46:14 +00:00
steve 9d2e22576e support functor_set push for blocking assignment. 2001-04-03 03:18:34 +00:00
steve 3ffb3c7011 thread bit allocation leak in assign. 2001-04-02 04:09:20 +00:00
steve cac4c8d5ce Evaluate binary & and | operators. 2001-04-02 03:47:49 +00:00
steve f40d006c26 Generate code for task calls. 2001-04-02 02:28:12 +00:00
steve e6c36597eb Support the scope expression node. 2001-04-02 00:28:35 +00:00
steve 141808b787 Scopes and numbers as vpi_call parameters. 2001-04-02 00:27:53 +00:00
steve 003f103408 Take numbers as system task parameters. 2001-04-02 00:24:30 +00:00
steve ce66498c88 Unary ! is a reduction operator. 2001-04-01 22:26:21 +00:00
steve bf30a0bc07 Add the reduction nor instruction. 2001-04-01 22:25:33 +00:00
steve f8e6d782e1 Implement the unary ! operator. 2001-04-01 21:47:29 +00:00
steve 7a8135c703 Recognize the BUF device. 2001-04-01 21:34:48 +00:00
steve 311e1ce9ee Add the buf functor type. 2001-04-01 21:31:46 +00:00
steve 9bce21ddb7 Generate code for < and <=. 2001-04-01 07:22:42 +00:00
steve c4e438d4ba Implement the less-then and %or instructions. 2001-04-01 07:22:08 +00:00
steve a2da2d59df support the NetWhile statement. 2001-04-01 06:52:27 +00:00
steve 56a4236576 Evaluate the logical AND operator. 2001-04-01 06:49:32 +00:00
steve 2443c655f2 Generate code for while statements. 2001-04-01 06:49:04 +00:00
steve ae1d5227de Support empty statements for hanging labels. 2001-04-01 06:40:44 +00:00
steve 5769bbe15e Add the bitwise %and instruction. 2001-04-01 06:12:13 +00:00
steve 6dbf7333c8 dead cruft. 2001-04-01 04:38:17 +00:00
steve 4352ce6753 Generate code for casex and casez 2001-04-01 04:34:59 +00:00
steve 29a50a52ca Implement %cmp/x and %cmp/z instructions. 2001-04-01 04:34:28 +00:00
steve d25690cc8e Redesign event information to support arbitrary edge combining. 2001-04-01 01:48:21 +00:00
steve e29ecdc234 Fix compilation warnings. 2001-03-31 19:29:23 +00:00
steve 0f6eea7024 Handle $time as system task parameter. 2001-03-31 19:08:22 +00:00
steve 97dd559fca Clear results of condition expressions. 2001-03-31 19:02:13 +00:00
steve a4c722b195 Add VPI support for the simulation time. 2001-03-31 19:00:43 +00:00
steve b3a3b888d8 Generate vvp code for case statements. 2001-03-31 17:36:38 +00:00
steve 2f1d258acb Add the jmp/1 instruction. 2001-03-31 17:36:02 +00:00
steve 7aa9bc9892 Generate code for + and concat expressions. 2001-03-31 02:00:44 +00:00
steve 4a058632b2 Add the ADD instrunction. 2001-03-31 01:59:58 +00:00
steve 6a72b4c10e Make empty event sub-expression a noop. 2001-03-30 23:24:02 +00:00
steve 00d44222dd Initialize the event_ list of new scopes. 2001-03-30 06:10:15 +00:00
steve b36b6d0ca0 Generate code for fork/join statements. 2001-03-30 05:49:52 +00:00
steve 386958f9a0 Add fork and join instructions. 2001-03-30 04:55:22 +00:00
steve f6eb581aff Handle truncation/padding of numbers. 2001-03-29 05:16:25 +00:00
steve 966f7a4bff Behavioral trigger statements. 2001-03-29 03:47:38 +00:00
steve 2cb76cabef events can take up to 4 inputs. 2001-03-29 03:47:13 +00:00
steve 609d5fe727 Support named events as mode 2 functors. 2001-03-29 03:46:36 +00:00
steve 522d0ec864 Add unary ~ operator to tgt-vvp. 2001-03-29 02:52:39 +00:00
steve ad8565f8a6 Add const probe method to NetEvent. 2001-03-29 02:52:01 +00:00
steve b0c003dc34 include string.h for strcmp et al. 2001-03-28 17:24:32 +00:00
steve a4e528f0c3 Add the ivl_event_t to ivl_target, and use that to generate
.event statements in vvp way ahead of the thread that uses it.
2001-03-28 06:07:39 +00:00
steve c8d9ade58c Evaluate === and !== 2001-03-27 06:43:27 +00:00
steve 61e3eed49c Generate code for simple @ statements. 2001-03-27 06:27:40 +00:00
steve afb8e285db Support error code from target_t::end_design method. 2001-03-27 03:31:06 +00:00
steve 79ce94b585 Add the .event statement and the %wait instruction. 2001-03-26 04:00:39 +00:00
steve f7f5ccce05 Add vpiOctStrVal access to signals. 2001-03-25 20:45:09 +00:00
steve 25d25ff7fe Support NOR and NOT gates. 2001-03-25 19:38:23 +00:00
steve 31b0037299 Support making hex strings. 2001-03-25 19:38:05 +00:00
steve 16f514739f Calculate NOR and NOT tables, and also the hex_digits table. 2001-03-25 19:37:26 +00:00
steve 604ce0db09 Accept <> characters in labels and symbols. 2001-03-25 19:36:45 +00:00
steve a71dbd3987 Draw AND NOR and NOT gates. 2001-03-25 19:36:12 +00:00
steve 417186b06f Add a README for notes about the vvp target. 2001-03-25 18:10:39 +00:00
steve ac91dc38b8 Recursive make check target. 2001-03-25 05:59:46 +00:00
steve 6d0be3de3a vpip.def needed by vpip, not vvm. 2001-03-25 04:48:04 +00:00
steve 2d4f33a0dd Use the correct paths for vpip in make check. 2001-03-25 04:47:47 +00:00
steve c6088c8820 Add JMP0XZ and postpone net inputs when needed. 2001-03-25 03:54:26 +00:00
steve 5134636932 Include signal bit index in functor input. 2001-03-25 03:53:40 +00:00
steve 5d051ffbde Skip true clause if condition ix 0, x or z 2001-03-25 03:53:24 +00:00
steve 97985bba64 Generate .net statements, and nexus inputs. 2001-03-25 03:25:43 +00:00
steve 9ec5fa972e Draw signal inputs to system tasks. 2001-03-25 03:24:10 +00:00
steve 9e04ef4abd Add the .net statement. 2001-03-25 00:35:35 +00:00
steve 68dc83b322 Use the :vpi_module directive. 2001-03-25 00:34:40 +00:00
steve 97e9b62080 Describe the .net directive. 2001-03-24 22:59:28 +00:00
steve 4072021ba4 Install vvp and vvp.tgt. 2001-03-24 22:58:56 +00:00
steve c901945871 eq is x if either value of cmp/u has x or z. 2001-03-23 04:56:03 +00:00
steve 95281e5d82 Generate :module statements. 2001-03-23 02:41:04 +00:00
steve 2858c2f09b Add the :module header statement. 2001-03-23 02:40:22 +00:00
steve 034cdae445 assignments with non-trival r-values. 2001-03-23 01:54:32 +00:00
steve e71ea8c9de Support set of functors from thread bits. 2001-03-23 01:53:46 +00:00
steve b2a136e07e Handle vectors pulled out of a constant bit. 2001-03-23 01:11:06 +00:00
steve c2dc3fe5c3 Assure that operands are the correct width. 2001-03-23 01:10:24 +00:00
steve 548ff4f89a Detect undefined system tasks at compile time. 2001-03-22 22:38:13 +00:00
steve b3c24adb11 install vvp. 2001-03-22 22:37:36 +00:00
steve e81d0d9f23 Compile in a default VPI module dir. 2001-03-22 21:26:53 +00:00
steve 715d140d85 Test print that interferes with output. 2001-03-22 05:39:34 +00:00
steve fa46de1021 Add code label forward references. 2001-03-22 05:28:41 +00:00
steve aa31884d3b no longer need out message. 2001-03-22 05:28:16 +00:00
steve aacce5ef1b implement %load, %inv, %jum/0 and %cmp/u 2001-03-22 05:08:00 +00:00
steve 565088160e Geneate code for conditional statements. 2001-03-22 05:06:21 +00:00
steve b24011b84b fgetc patch from Peter Monta. 2001-03-22 02:23:17 +00:00
steve 2b8d9abd3e Allow var objects as vpiHandle arguments to %vpi_call. 2001-03-21 05:13:03 +00:00
steve e24facfaf6 Describe the compilation major steps. 2001-03-21 05:12:15 +00:00
steve 27e717839a Scan the scopes of a design, and draw behavioral
blocking  assignments of constants to vectors.
2001-03-21 01:49:43 +00:00
steve 52c7108782 Add support for variable vectors. 2001-03-20 06:16:23 +00:00
steve 90ed3dd124 Copyright notices. 2001-03-20 02:48:40 +00:00
steve 8118203766 Lexical numbers may be signed. 2001-03-20 02:45:25 +00:00
steve e8518c5056 Put processes in the proper scope. 2001-03-20 01:44:13 +00:00
steve f02d4574f9 Get vpi_user from .., not ../vpip. 2001-03-20 01:43:16 +00:00
steve f1ff1149f7 vpi_user.h is in .., and not ./vpi. 2001-03-20 00:29:10 +00:00
steve 034a38ea36 Fix inclule paths to find files in srcdir. 2001-03-19 04:37:59 +00:00
steve f8c3b84f68 Add support for the vpiReset sim control. 2001-03-19 01:55:38 +00:00
steve d8ef63efd1 Pass -o value to vvp target. 2001-03-19 01:29:13 +00:00
steve a240be73e7 vpi_user header file is a root header. 2001-03-19 01:21:45 +00:00
steve 1563643c92 Add the tgt-vvp code generator target. 2001-03-19 01:20:46 +00:00
steve 5b89249f10 Add the hello example program. 2001-03-18 04:37:35 +00:00
steve bf70673380 Accept empty statements. 2001-03-18 04:37:16 +00:00
steve 6779f01f3a Add support for string constants to VPI. 2001-03-18 04:35:18 +00:00
steve 66f7ef97da Add support for vpi scopes. 2001-03-18 00:37:55 +00:00
steve e03859b834 $display can take 0 arguments. 2001-03-18 00:31:32 +00:00
steve f2c1902984 Add structures for VPI support, and all the %vpi_call
instruction. Get linking of VPI modules to work.
2001-03-16 01:44:34 +00:00
steve 32f3881344 Rearrange VPI support libraries. 2001-03-14 19:27:44 +00:00
steve 264e629c74 VPI support documentation. 2001-03-14 19:26:58 +00:00
steve 8969ab03d7 Thread details 2001-03-14 19:26:40 +00:00
steve 952ebe8516 Copyright notice. 2001-03-14 19:26:15 +00:00
steve f355cf334c Stub install and unistall targets. 2001-03-14 19:26:01 +00:00
steve 01c5321208 Add chapter on threads vs functors vs events. 2001-03-13 00:49:50 +00:00
steve 970ba895c9 Compact the vvp_code_s structure. 2001-03-11 23:06:49 +00:00
steve cbc3be0304 Functor values and propagation. 2001-03-11 22:42:11 +00:00
steve cb65ee5e00 Add the vvp engine to cvs. 2001-03-11 00:29:38 +00:00
steve debe707097 check signals in the cprop functor. 2001-02-18 01:07:32 +00:00
steve 79b60da54c I allow function ports to have types. 2001-02-17 05:27:31 +00:00
steve 84c7795d16 Allow task ports to be given real types. 2001-02-17 05:15:33 +00:00
steve 410a93b52c Cannot elide task ports. 2001-02-17 05:14:35 +00:00
steve 78355b6038 Check that the port really exists here. 2001-02-17 05:13:36 +00:00
steve 59b69c6dd1 Constant propagation for compare ==. 2001-02-16 03:27:31 +00:00
steve d3bff8a451 links to root inputs are not constant. 2001-02-16 03:27:07 +00:00
steve 43ddd97426 Missing . in names generated from scope locals. 2001-02-16 03:25:09 +00:00
steve 4399042b8d Use Mersenne Twister 19937 pseudo-random number generator
for the $random system task, and support the seed paramter.
2001-02-16 00:26:38 +00:00
steve 2b0aaec8ab FreeBSD port has a maintainer now. 2001-02-15 06:59:35 +00:00
steve 7d7ccd4f08 Generate proper code for wide condition expressions. 2001-02-13 04:11:24 +00:00
steve 93463b6ff5 Binary or and nor resilient to bit widths. 2001-02-13 03:38:55 +00:00
steve 4b0c56c3a8 Rant about bit widths. 2001-02-12 16:48:04 +00:00
steve 1bae567728 Add the netmisc.cc source file. 2001-02-11 02:15:52 +00:00
steve 7d7beeecc1 Binary operators with operands of indefinite width
has itself an indefinite width.
2001-02-10 21:20:38 +00:00
steve f5d0211864 In the context of range declarations, use elab_and_eval instead
of the less robust eval_const methods.
2001-02-10 20:29:39 +00:00
steve 1f4232187c Slightly more specific error message. 2001-02-10 19:50:33 +00:00
steve f45ba008d8 Catch constants driving root module ports. (PR#130) 2001-02-10 04:50:54 +00:00
steve ac629b313c Report errors when XNF code has constant X values. (PR#128) 2001-02-10 03:22:49 +00:00
steve 563065053e Make the add func resilient to bit widths (PR#141) 2001-02-10 01:57:18 +00:00
steve 2b903f5d0e Detect part select out of range in nets. (PR#138) 2001-02-09 20:18:15 +00:00
steve 7ef3b44ab1 support evaluation of constant < in expressions. 2001-02-09 05:44:23 +00:00
steve 8376553349 Report bit/part select out of range errors. (PR#133) 2001-02-09 03:16:48 +00:00
steve 3885f17d0f Be more clear about scope of failure. 2001-02-09 02:49:59 +00:00
steve 4b0e5bd173 trim the length of unsized numbers. 2001-02-08 05:38:18 +00:00
steve d78c7392c2 Remove dead code. 2001-02-08 01:10:30 +00:00
steve cf3f1b38c3 ivl_target header search path fixes. 2001-02-07 22:21:59 +00:00
steve 2fbc0af1ea Fix expression widths for rvalues and parameters (PR#131,132) 2001-02-07 21:47:13 +00:00
steve 94a1d59817 Support constant evaluation of / and % (PR#124) 2001-02-07 02:46:31 +00:00
steve 57d1bfaf29 Add 0? and 1? patterns to UDP syntax. (PR#137) 2001-02-07 01:08:21 +00:00
steve d6701803d1 Latest rpm compresses man pages. Fine, I can cope. 2001-02-04 01:00:51 +00:00
steve 9e624ac833 Update to 0.4 release. 2001-02-04 00:03:57 +00:00
steve 0175c727ee The -f flag is obsolete. 2001-02-01 17:12:44 +00:00
steve 90250baf0f Forgot to actually allow the -p flag. 2001-02-01 17:12:22 +00:00
steve cc22ae833a support leading _ in names. 2001-01-29 22:48:10 +00:00
steve 6c4b5cf2c2 Fix sign extension of evaluated constants. (PR#91) 2001-01-27 05:41:48 +00:00
steve 88a2ca2168 Handle wide net constants with unary minus. 2001-01-25 02:05:16 +00:00
steve 41242735ed Handle some special cases of unary 2's complement,
and improve netlist expression width handling.
2001-01-24 02:52:30 +00:00
steve ab11943496 Fix hand bad karma btw AC_LANG_CPLUSPLUS and AC_EXEEXT 2001-01-23 19:52:03 +00:00
steve d9f0065f93 Forgot to actually *open* the VCD output. 2001-01-23 18:50:26 +00:00
steve 53dfdacce8 Support default dumpfiles. 2001-01-22 20:58:31 +00:00
steve 4e44515078 Switch hte -f flag to the -p flag. 2001-01-20 19:02:04 +00:00
steve 2b11f78d63 Catch malformed include directives (PR#100) 2001-01-20 03:10:35 +00:00
steve a4de0af79d apologize for not supporting non-constant delays. 2001-01-20 02:15:50 +00:00
steve 145ac49233 NetMux needs a scope. (PR#115) 2001-01-18 03:16:35 +00:00
steve 6479319fea LDFLAGS when linking pal.tgt. 2001-01-18 03:09:45 +00:00
steve f224ed3a90 Fix out-of-bound pins for comparator (PR#108) 2001-01-16 04:51:52 +00:00
steve 5f292e546d Get rid of gate templates. 2001-01-16 03:57:46 +00:00
steve 65020bc6de Use the iosfwd header if available. 2001-01-16 02:44:17 +00:00
steve 6adb50e860 Add missing NetLogic gate types to ::logic method. 2001-01-15 22:08:32 +00:00
steve 1ea417dc30 Declare ivl_scope_type functions. 2001-01-15 22:05:14 +00:00
steve a00924089d Pass scope type information to the target module. 2001-01-15 00:47:01 +00:00
steve 66716f5101 Add client data pointer for scope and process scanners. 2001-01-15 00:05:39 +00:00
steve 219df169a3 Generalize the evaluation of floating point delays, and
get it working with delay assignment statements.

 Allow parameters to be referenced by hierarchical name.
2001-01-14 23:04:55 +00:00
steve b712c3f5ca possible HP/UX portability support. 2001-01-14 17:12:59 +00:00
steve 02fc59fbdf Parse parameters within nested scopes. 2001-01-13 22:20:08 +00:00
steve 4e7a5d55d0 Handle error idents in constants not in any scope (PR#97) 2001-01-12 04:31:27 +00:00
steve 5fb7f9ca91 Generated function prototype. (PR#107) 2001-01-12 04:20:18 +00:00
steve 246f2d5884 Match memories within task scopes. (PR#101) 2001-01-10 05:32:44 +00:00
steve 5276752276 Build task outputs as lval instead of nets. (PR#98) 2001-01-10 03:13:23 +00:00
steve 6bf599e839 Cope with width mismatches to module ports (PR#89) 2001-01-09 05:58:47 +00:00
steve fff32b1b54 Clean up the jedec header that is written. 2001-01-09 04:41:32 +00:00
steve a64a4d7a9b Fixes to support compilation using vpath. 2001-01-09 03:11:27 +00:00
steve 9eb6f9dbb9 Generate the jedec to configure the macrocells. 2001-01-09 03:10:48 +00:00
steve 430e46d718 Assert on length of bit vector. 2001-01-07 18:22:15 +00:00
steve cd9a30707b Detect port direction attached to non-ports. 2001-01-07 07:00:31 +00:00
steve ad0853d666 Support signed decimal display of variables. 2001-01-06 22:22:17 +00:00
steve cc18d065aa declaration initialization for time variables. 2001-01-06 06:31:58 +00:00
steve 14c67a5389 James has moved. 2001-01-06 04:32:56 +00:00
steve 68e672e61a Support arrays of integers. 2001-01-06 02:29:35 +00:00
steve 2703456ad4 Document the -c flag. 2001-01-05 05:16:03 +00:00
steve 8ee00ec562 Fix net division to cope with small output sizes. 2001-01-05 03:19:47 +00:00
steve 8bfae1e641 Evaluate constant === and !== expressions. 2001-01-04 16:49:50 +00:00
steve 8befc6f7c4 Add support for << is signal indices. 2001-01-04 04:47:51 +00:00
steve d5ec89813d Evaluate constant logical && and ||. 2001-01-04 04:28:42 +00:00
steve ac7ae1ba6f Resolve repeat ambiguity in favor of loop. 2001-01-02 17:28:08 +00:00
steve 120a211e68 Support a bunch of unary operators in parameter expressions. 2001-01-02 04:21:13 +00:00
steve b6a18098c7 Evaluate constant &, | and unary ~. 2001-01-02 03:23:40 +00:00
steve 112936d661 Fix shift and ternary operators in parameter expressions (PR#86) 2001-01-01 21:49:33 +00:00
steve 4d09c43ecf Add $stop that does a finish. 2001-01-01 19:33:44 +00:00
steve 2a6f8634f6 repeat loops ambiguity. 2001-01-01 19:12:35 +00:00
steve 5803e8c42c Handle function scopes in dumpvars scn (PR#95) 2001-01-01 08:10:35 +00:00
steve eda3c63f72 reg_assign into function ports. (PR#95) 2001-01-01 01:41:09 +00:00
steve 365b149ec1 Propagate initial value of constants into wires. 2000-12-30 03:11:15 +00:00
steve e68c26bb87 Generate smaller code for reg assigns. 2000-12-17 05:33:11 +00:00
steve 4e7f8766fa Generate loops to initialize vectors or constants. 2000-12-16 23:55:24 +00:00
steve fe209a6996 Handle non-constant l-values. 2000-12-16 20:00:17 +00:00
steve f4671a3082 Evaluate <= and ?: in parameter expressions (PR#81) 2000-12-16 19:03:30 +00:00
steve c9881c115a Spelling error. 2000-12-16 17:16:08 +00:00
steve 0a3bda87d6 Observe delays in non-blocking assignments (PR#83) 2000-12-16 16:57:43 +00:00
steve 8ae4e25720 Detect recursive instantiations (PR#2) 2000-12-16 01:45:47 +00:00
steve 44131d4b16 Allow non-blocking assign to pad memory word with zeros. 2000-12-15 21:54:43 +00:00
steve d5eb3a2bad concatenation as parameter to system tasks. PR#64) 2000-12-15 21:40:26 +00:00
steve 086348035e Fix memory access in vvm. (PR#70) 2000-12-15 20:05:16 +00:00
steve 05b5b91a84 A dlerror implementatin that HP/UX might like. 2000-12-15 18:06:47 +00:00
steve bcbd5b2c5c Remove limits from the similar events search. 2000-12-15 17:45:07 +00:00
steve 8c680d158a Autoconfigure the dlopen functions. 2000-12-15 05:45:25 +00:00
steve 8fe6324aec functions with system tasks (PR#46) 2000-12-15 03:06:04 +00:00
steve 15a426cc73 remove dead macro. 2000-12-15 02:00:31 +00:00
steve 770dfe5eaa Trim dr from the string line. 2000-12-15 02:00:11 +00:00
steve 5144725b8f Accept x in outputs of primitive. (PR#84) 2000-12-15 01:24:17 +00:00
steve 189f55b894 rounding of time and x in primitives. 2000-12-15 00:21:46 +00:00
steve e836bc951d Detect -mdll support in Cygwin. 2000-12-14 23:38:04 +00:00
steve f0718b1345 Start support for fitting the logic. 2000-12-14 23:37:47 +00:00
steve 9cb91ce9aa Eat carriage returns. 2000-12-14 23:36:59 +00:00
steve 4abf4b0a9a include vpi_user.h. 2000-12-14 23:36:34 +00:00
steve 7d622fc6ab Support more logic gate types. 2000-12-14 23:23:07 +00:00
steve 3e73ec3e0f sorry for concatenated memories in l-values. (PR#76) 2000-12-12 06:14:51 +00:00
steve 36a1b37789 Fix truncated octal constants (PR#76) 2000-12-12 06:13:44 +00:00
steve e34ef2a2b9 NetEUFuncs are allowed as system task parameters. 2000-12-12 03:30:44 +00:00
steve fd0f618529 out-line vvm_bitset_t methods. 2000-12-12 03:30:25 +00:00
steve a010dd1cc0 Mangle [] characters. (PR#67) 2000-12-11 01:06:24 +00:00
steve 5dbea64759 Add support for signed reg variables,
simulate in t-vvm signed comparisons.
2000-12-11 00:31:43 +00:00
steve 084a464cf1 Support decimal constants in behavioral delays. 2000-12-10 22:01:35 +00:00
steve c0f951c146 vpiStringVal handles leding nulls as blanks. (PR#62) 2000-12-10 19:15:19 +00:00
steve 9ddd0491f7 Support delays on continuous assignment from idents. (PR#40) 2000-12-10 06:41:59 +00:00
steve 245472ca63 unary expressions as parameters (PR#42, PR#68) 2000-12-09 06:17:20 +00:00
steve 371f43e227 documentation... 2000-12-09 05:40:42 +00:00
steve 9fe0d9b120 Add the -tpal target to use the pal.tgt module. 2000-12-09 05:40:09 +00:00
steve 16c50ad810 Stuff registers into macrocells. 2000-12-09 03:42:52 +00:00
steve a4da2c7ed5 The ipal library is called ipal. 2000-12-09 01:19:58 +00:00
steve 40da501cec Add the pal loadable target. 2000-12-09 01:17:38 +00:00
steve f6507cba43 Check lvalue of procedural continuous assign (PR#29) 2000-12-06 06:31:09 +00:00
steve e027247a0e fix portfaults pass values. 2000-12-06 05:15:21 +00:00
steve 789e862ca4 parse real and realtime declarations. 2000-12-05 22:32:05 +00:00
steve a6b83ac5da real and trireg not supported. 2000-12-05 22:31:38 +00:00
steve 3b9a60414e Make signal attributes available to ivl_target API. 2000-12-05 06:29:33 +00:00
steve 4f638882c9 Add Attrib class for holding NetObj attributes. 2000-12-04 17:37:03 +00:00
steve 4faec154f0 Finally remove the verilog.sh script. 2000-12-02 05:57:46 +00:00
steve ff53b60c66 Remove excess *.d dependencies for parse.d 2000-12-02 05:30:08 +00:00
steve a2a40869b0 Spelling error in comment. 2000-12-02 05:08:04 +00:00
steve b714f57797 Catch up to null.tgt and libvpip.a files. 2000-12-02 05:07:14 +00:00
steve d0ec7e2c02 Make the null target into a loadable target. 2000-12-02 04:50:32 +00:00
steve d16d29c591 Support for %s in $display (PR#62) 2000-12-02 02:40:56 +00:00
steve e310532434 Handle null statements inside a wait. (PR#60) 2000-12-01 23:52:49 +00:00
steve 4eed86d519 Detect part select errors on l-values. 2000-12-01 02:55:37 +00:00
steve ef49fc127f Change LineInfo to store const C strings. 2000-11-30 17:31:42 +00:00
steve e6151db172 Add command file (-c) support from Nadim Shaikli. 2000-11-30 02:50:54 +00:00
steve 28af357c8a Clean a bit more completely. 2000-11-29 23:59:29 +00:00
steve a5c69b50e5 Do not delete synthesized signals used in expressions. 2000-11-29 23:16:18 +00:00
steve 02f876ac69 More informative BUFZ warning. 2000-11-29 23:15:54 +00:00
steve ea921efced synthesis for unary reduction ! and N operators. 2000-11-29 05:24:00 +00:00
steve 4bf3e37af3 Add XNF support for NE comparators. 2000-11-29 02:54:49 +00:00
steve 291ab97422 Add support for || synthesis (PR#53) 2000-11-29 02:09:52 +00:00
steve 12db3340cc Typo writing I pins to AND gates in compare. 2000-11-29 01:34:17 +00:00
steve e33fb3ce51 Propagate constants through xnor gates. (PR#51) 2000-11-23 01:55:52 +00:00
steve 92424eea10 synthesize the rvalue of <= statements. 2000-11-22 21:18:42 +00:00
steve 4ca0bffc7f Connect the CE if it is linked at all. 2000-11-22 21:18:20 +00:00
steve c86da66b77 Allow sole module to be a root. 2000-11-22 20:48:32 +00:00
steve f7d62b96aa whoops, wrong copyright notice. 2000-11-21 03:55:20 +00:00
steve 482323843e Whoops, return the calculated constant value rom driven_value. 2000-11-20 01:41:12 +00:00
steve f4443a7dfa Add support for supply nets (PR#17) 2000-11-20 00:58:40 +00:00
steve 1f07ba52b6 Integer parameter comments. 2000-11-19 22:03:04 +00:00
steve ec0d12b738 Killing some signals might make others killable. 2000-11-19 20:48:53 +00:00
steve 457d193238 Fix cases where signal iteration might die early. 2000-11-19 20:48:30 +00:00
steve e05b9a4769 Replace AND constand propagation. 2000-11-19 05:26:58 +00:00
steve 2750977e4a Thorough constant propagation for or and nor gates. 2000-11-18 05:13:27 +00:00
steve ff5846100c Delete unreferenced signals no matter what. 2000-11-18 05:12:45 +00:00
steve da926fa08b Watch out in functor, it may delete the last signal. 2000-11-18 04:53:04 +00:00
steve fc6978e4de Handle constant propagation through XOR gates,
including reducing the gate to a constant,
 a buffer or an inverter if possible.
2000-11-18 04:10:37 +00:00
steve 11e6440162 Fix warning about temporaries. 2000-11-15 20:31:05 +00:00
steve f74368dec2 Missing LPM related symbols in ivl.def. 2000-11-15 20:30:21 +00:00
steve 4b264a4c58 More robust way to cope with parse.cc compilation. 2000-11-15 19:26:35 +00:00
steve 0ca9b2736b flip-flop pins for ivl_target API. 2000-11-12 17:47:29 +00:00
steve 28bc621f11 change set for support of nmos, pmos, rnmos, rpmos, notif0, and notif1
change set to correct behavior of bufif0 and bufif1
 (Tim Leight)

 Also includes fix for PR#27
2000-11-11 01:52:09 +00:00
steve 197ed46b26 configure bindir and libdir 2000-11-11 00:48:35 +00:00
steve b05aadfd94 Configure bindir and libdir 2000-11-11 00:38:40 +00:00
steve a8da692540 Add support for the t-dll backend grabing flip-flops. 2000-11-11 00:03:36 +00:00
steve 1d6f48914f Initialize scope when creating it. 2000-11-09 22:19:34 +00:00
steve 1046c86c84 Remember to include the -S condition. 2000-11-09 21:58:00 +00:00
steve 47ce0f3c46 show concatenation operators. 2000-11-09 05:14:07 +00:00
steve 2dd1d070ec Display l-values with width. 2000-11-07 06:14:06 +00:00
steve f4ed0e35af Handle connectsion to internally unconnected modules (PR#38) 2000-11-05 06:05:59 +00:00
steve 61ad0b23c8 Apply sequential UDP rework from Stephan Boettcher (PR#39) 2000-11-04 06:36:24 +00:00
steve 5415dd70c5 Integrate parameter count changes (PR#34) 2000-11-04 05:49:22 +00:00
steve ff514aab72 pad different width inputs to muxes. (PR#14) 2000-11-04 05:06:04 +00:00
steve d7788b88b7 Modifications in support of gcc 2.96 2000-11-04 01:54:01 +00:00
steve a1cfabafb8 Use the %m string properly. 2000-11-04 01:53:24 +00:00
steve 35769ef541 Scope information is needed by all types of display tasks. 2000-11-04 01:52:57 +00:00
steve 80d3342178 VCD scans tasks (PR#35) 2000-11-01 06:05:44 +00:00
steve 4d27b947bc Add the general $time system function. 2000-11-01 03:19:36 +00:00
steve 3591e06c4e Support time variables. 2000-10-31 17:49:02 +00:00
steve 88c8547486 Remove C++ string from variable lists. 2000-10-31 17:00:04 +00:00
steve d92ac5772c Spelling error. 2000-10-31 16:59:45 +00:00
steve f2997d7767 Detect reverse bit order in part select. (PR#33) 2000-10-30 21:35:40 +00:00
steve 7df9943679 get width right for reversed part select net. (PR#33) 2000-10-30 20:55:53 +00:00
steve f3dfff7d76 task threads ned their scope initialized. (PR#32) 2000-10-29 17:10:02 +00:00
steve 23a5bd072d Remove the compiled in Verilog target. 2000-10-28 22:35:58 +00:00
steve d6efae4bdd API for concatenation expressions. 2000-10-28 22:32:34 +00:00
steve 10fbb2a1bb Glitches in cygwin build process. 2000-10-28 19:12:43 +00:00
steve 5b65f15df4 stub for the concat operator. 2000-10-28 17:55:03 +00:00
steve 72229abda6 check explicitly uses local libraries. 2000-10-28 17:51:45 +00:00
steve 427de3ab0b Handle - and _ in target names. 2000-10-28 17:51:01 +00:00
steve 6962841546 Split vpip for everybody. 2000-10-28 17:27:59 +00:00
steve bb414303a0 make check target (PR#3) 2000-10-28 04:16:11 +00:00
steve 431228e881 make check target (PR#3) 2000-10-28 03:58:11 +00:00
steve 07d7008853 Use the conf file to generate the vvm ivl string. 2000-10-28 03:45:47 +00:00
steve 7545db5e26 Use the conf file to generate the vvm ivl string. 2000-10-28 03:45:47 +00:00
steve ad4931e813 Add scope to threads in vvm, pass that scope
to vpi sysTaskFunc objects, and add vpi calls
 to access that information.

 $display displays scope in %m (PR#1)
2000-10-28 00:51:41 +00:00
steve f915efaf15 Fix handling of errors in behavioral lvalues. (PR#28) 2000-10-26 17:09:46 +00:00
steve df660bab0c draw proper signal references for the gates. 2000-10-26 16:42:25 +00:00
steve 26350fdcf5 emit declarations of signals and gates. 2000-10-26 00:32:28 +00:00
steve 0e7ca326ce Put signals into a signal_table 2000-10-26 00:29:10 +00:00
steve 88b479a82b mangle the backslash to a dollar. 2000-10-25 23:21:37 +00:00
steve e08314eaf5 Scan the processes, and get the target signals 2000-10-25 05:41:55 +00:00
steve b8fe10d27d Get target signal from nexus_ptr. 2000-10-25 05:41:24 +00:00
steve 1cc7b6d4d7 Nexus value is initially unknown so that it propogates for sure. 2000-10-23 00:32:48 +00:00
steve bb9eb2cd1d Fix decimal constant overflow warning (PR#26) 2000-10-22 22:27:59 +00:00
steve add2ae16fa Reduce the target entry points to the target_design. 2000-10-21 16:49:45 +00:00
steve ecf71efc84 Document the -C flag of iverilog. 2000-10-18 21:53:05 +00:00
steve e10679633d Add ivl_lval_t and support for assignment l-values. 2000-10-18 20:04:39 +00:00
steve f5fae7f271 Stubs so that cygwin port will link ivl. 2000-10-16 22:44:54 +00:00
steve 90ae46476c Makefile patches to support target loading under cygwin. 2000-10-15 21:02:08 +00:00
steve 2dedd6c067 Scopes and processes are accessible randomly from
the design, and signals and logic are accessible
 from scopes. Remove the target calls that are no
 longer needed.

 Add the ivl_nexus_ptr_t and the means to get at
 them from nexus objects.

 Give names to methods that manipulate the ivl_design_t
 type more consistent names.
2000-10-15 04:46:23 +00:00
steve 7ee46bc621 More sophisticated number length warning. 2000-10-14 16:48:59 +00:00
steve 368e5b72be bit width warnings from Jim Norris (PR#24) 2000-10-14 04:07:54 +00:00
steve f526d235d1 Check for missing concat subexpressions (PR#11) 2000-10-14 02:23:02 +00:00
steve 06f5482631 Skip the o radix in octal numbers. 2000-10-14 01:31:30 +00:00
steve 52b649cd5e Include constants in nexus targets. 2000-10-13 03:39:27 +00:00
steve 588966320f commentary. 2000-10-13 03:38:48 +00:00
steve 5ce28c193a iverilog with an iverilog.conf configuration file. 2000-10-08 22:36:55 +00:00
steve c9bcda147e Missing stream in call to fprintf. 2000-10-08 05:00:04 +00:00
steve 4819d54d51 Fix repeat concatenation with multiple expressions (PR#10) 2000-10-08 04:59:36 +00:00
steve 8fe887ffe1 Back pointers in the nexus objects into the devices
that point to it.

 Collect threads into a list in the design.
2000-10-08 04:01:54 +00:00
steve 76e2c509d7 Put logic devices into scopes. 2000-10-07 19:45:42 +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 8ba1facb66 Replace data references with function calls. (Venkat) 2000-10-06 23:11:39 +00:00
steve 20d07a7366 Eliminate zero inputs to xor. 2000-10-06 21:26:34 +00:00
steve 02bee9358c sfuncs are char* and are compared with strcmp 2000-10-06 02:21:35 +00:00
steve 41f3ba65a1 xor and constant devices. 2000-10-05 05:03:01 +00:00
steve ce19190eae Overview documentation for loadable targets. 2000-10-04 22:13:51 +00:00
steve d7fcd66826 Overview documentation for loadable targets. 2000-10-04 21:50:55 +00:00
steve 9680de25cd Fix the clean target and excess dependencies. 2000-10-04 17:08:31 +00:00
steve aac5fc246a Use char8 instead of string to store name. 2000-10-04 16:30:39 +00:00
steve 887654b7c5 Use .def file instead of _dllexport. 2000-10-04 02:37:44 +00:00
steve 07aa86f0fa print reg signals. 2000-10-04 02:24:20 +00:00
steve 2f668421a3 Strip the installed .vpi file. 2000-10-04 02:01:40 +00:00
steve bb777f317b Cleanup build of VPI modules under Cygwin. (Venkat) 2000-10-03 16:15:35 +00:00
steve b34a451cbc Cygwin port changes from Venkat 2000-09-30 03:20:47 +00:00
steve c12e0f5416 ivl_expr_t support for binary operators,
Create a proper ivl_scope_t object.
2000-09-30 02:18:15 +00:00
steve 40028f263f Do not put noop statements into blocks. 2000-09-29 22:58:57 +00:00
steve 21e0e8a8a1 Cnstant evaluation of NE. 2000-09-29 04:42:56 +00:00
steve 700bcfda70 handel, by truncation, verinums that are to long for long integers. 2000-09-28 03:55:55 +00:00
steve fff759de20 multiply in parameter expressions. 2000-09-27 18:28:37 +00:00
steve 79b1c51e68 Detect indefinite widths where definite widths are required. 2000-09-26 05:05:58 +00:00
steve 8b581cef46 Remove the obsolete NetEIdent class. 2000-09-26 01:35:42 +00:00
steve d6b43519a8 Add EX_NUMBER and ST_TRIGGER to dll-api. 2000-09-26 00:30:07 +00:00
steve cbe20e8bcf fix null pointer when elaborating undefined task. 2000-09-24 17:41:13 +00:00
steve e8bb53e2ea API access to signal type and port type. 2000-09-24 15:46:00 +00:00
steve 2be1c115ff Move some NetNet method out of the header file. 2000-09-24 15:44:44 +00:00
steve 36cc374ec9 Add support for signal expressions. 2000-09-24 02:21:53 +00:00
steve 043bd2876b Update documentation to use iverilog. 2000-09-23 17:46:11 +00:00
steve 57ced29227 Handle unknowns in decimal strings. 2000-09-23 16:34:47 +00:00
steve 80c69d565b Add enough tgt-verilog code to support hello world. 2000-09-23 05:15:07 +00:00
steve 3a2eff2265 Parse specify delay values. 2000-09-23 03:04:10 +00:00
steve 48ff3590bc Access to the name of a system task call. 2000-09-22 03:58:30 +00:00
steve 9067c91656 Correctly measure comples l-values of assignments. 2000-09-20 02:53:14 +00:00
steve 13c1378666 Remember to make the includedir. 2000-09-20 01:02:13 +00:00
steve 39cf6bd164 Introduce the means to get statement types. 2000-09-19 04:15:27 +00:00
steve ea53f2b54f Typo stepping ot next probe in delete. 2000-09-19 03:00:36 +00:00
steve effc84c46d Get the structure for ivl_statement_t worked out. 2000-09-18 01:24:32 +00:00
steve 89d7176734 Add support for modulus (Eric Aardoom) 2000-09-17 21:26:15 +00:00
steve f8478a4408 More thorough credits section. 2000-09-17 19:06:58 +00:00
steve 8978bbd5e6 full featured l-values for non-blocking assiginment. 2000-09-16 21:28:14 +00:00
steve 063d56ffc1 undefined macros are null (with warnings.) 2000-09-13 22:33:13 +00:00
steve 67472379b4 Error message for invalid variable list. 2000-09-13 16:32:26 +00:00
steve 7e9a7ed0cb Version information for vlog_vpi_info. 2000-09-12 01:17:40 +00:00
steve db1b53c1e7 Oops, the -m flag takes a parameter and needs the : 2000-09-12 01:17:19 +00:00
steve 68c6c48a18 Some error checking. 2000-09-10 15:43:59 +00:00
steve 3c94635f99 Agressively merge NetAssign_ within concatenations. 2000-09-10 03:59:59 +00:00
steve 8a69c54886 elaborate complex l-values 2000-09-10 02:18:16 +00:00
steve b6ce313e91 move lval elaboration to PExpr virtual methods. 2000-09-09 15:21:26 +00:00
steve 3ae76a8638 initialize vlog info. 2000-09-08 17:08:10 +00:00
steve d86b37d90f Support unary + and - in constants. 2000-09-07 22:38:13 +00:00
steve e27934a577 ack, detect when lval fails. 2000-09-07 22:37:48 +00:00
steve ddcba9d91f The + operator now preserves signedness. 2000-09-07 22:37:10 +00:00
steve 44438c9678 more robust abut ternary bit widths. 2000-09-07 21:28:51 +00:00
steve 4cf75adf94 Fix bit padding of assign signal-to-signal 2000-09-07 01:29:44 +00:00
steve 49570b8cd9 encapsulate access to the l-value expected width. 2000-09-07 00:06:53 +00:00
steve 24e46723b0 Change elaborate_lval to return NetAssign_ objects. 2000-09-03 17:58:35 +00:00
steve e95d0c3b87 Properly ignore NetAssign_ objects. 2000-09-03 17:58:14 +00:00
steve ece3f5e0a2 Slightly more helpful warning. 2000-09-03 17:57:53 +00:00
steve 115d24a292 Pull NetAssign_ creation out of constructors. 2000-09-02 23:40:12 +00:00
steve ac81f6a201 Rearrange NetAssign to make NetAssign_ separate. 2000-09-02 20:54:20 +00:00
steve ff32325d07 t-dll iterates signals, and passes them to the
target module.

 Some of NetObj should return char*, not string.
2000-08-27 15:51:50 +00:00
steve eb781a7441 Handle out of range part select expressions. 2000-08-26 01:31:29 +00:00
steve 8876cda37f Get at gate information for ivl_target interface. 2000-08-26 00:54:03 +00:00
steve df113f962b Clean up warnings and portability issues. 2000-08-20 17:49:04 +00:00
steve d0fc6d515d Add ivl_target support for logic gates, and
make the interface more accessible.
2000-08-20 04:13:56 +00:00
steve 3cb666dd2f Add target calls for scope, events and logic. 2000-08-19 18:12:42 +00:00
steve a59bbdeb4f Proper error messages when port direction is missing. 2000-08-18 04:38:57 +00:00
steve 9abd84952b add th t-dll functions for net_const, net_bufz and processes. 2000-08-14 04:39:56 +00:00
steve 3ae4d2cf91 use -fPIC for sparc. 2000-08-12 20:54:33 +00:00
steve 534521f88b Limit signal scope search at module boundaries. 2000-08-12 17:59:48 +00:00
steve 566aad9e15 Start stub for loadable targets. 2000-08-12 16:34:37 +00:00
steve 248baa26e1 Move all file manipulation out of target class. 2000-08-09 03:43:45 +00:00
steve 91a462e38c Add the -N switch to the iverilog command. 2000-08-09 01:34:00 +00:00
steve d58533fd7b target methods need not take a file stream. 2000-08-08 01:50:42 +00:00
steve dab45178a7 Add vpi_vlog_info support from Adrian 2000-08-08 01:47:40 +00:00
steve e01137ced3 cleanup. 2000-08-02 14:48:15 +00:00
steve b5a36fef70 use bufif0 if z is in true case of mux. 2000-08-02 14:48:01 +00:00
steve 2e3e9ecf37 tri01 support in vvm. 2000-08-02 00:57:02 +00:00
steve 60c2046be6 Extend x or z that is top bit of a constant. 2000-08-01 22:44:26 +00:00
steve 1325a3e2b6 Use the iverilog command in documentation. 2000-08-01 21:32:40 +00:00
steve d677f226f3 Support <= in synthesis of DFF and ram devices. 2000-08-01 02:48:41 +00:00
steve eb93e3d2f5 Treat CR as white space in timespec lines. 2000-08-01 02:14:34 +00:00
steve 7cccbda275 Handle different forms of line end. 2000-08-01 01:38:25 +00:00
steve 931ec257f0 Report error when dumpfile is missing. 2000-07-31 03:34:31 +00:00
steve b6562d3ed9 timescale and min:typ:max expressions *do* work onw. 2000-07-30 22:09:09 +00:00
steve 0243fca8dc Rearrange task and function elaboration so that the
NetTaskDef and NetFuncDef functions are created during
 signal enaboration, and carry these objects in the
 NetScope class instead of the extra, useless map in
 the Design class.
2000-07-30 18:25:43 +00:00
steve 30a81731dd Introduce min:typ:max support. 2000-07-29 17:58:20 +00:00
steve 3aa250b16b Report code generation errors through proc_delay. 2000-07-29 16:21:08 +00:00
steve 39c71ef68a fix problem coalescing events w/ probes. 2000-07-29 03:55:38 +00:00
steve 4494a7a4f3 Support elaboration of disable statements. 2000-07-27 05:13:44 +00:00
steve 739365abe5 Parse disable statements to pform. 2000-07-26 05:08:07 +00:00
steve 880b712140 Get VCD timescale from design precision. 2000-07-26 04:07:59 +00:00
steve 08e6bf2e27 Make simulation precision available to VPI. 2000-07-26 03:53:11 +00:00
steve 5f7c298a21 Fix RAM matching. 2000-07-26 03:52:59 +00:00
steve 34399cf297 memory is not a data type in verilog. 2000-07-25 22:49:32 +00:00
steve cb7b1b6c94 Unlink z constants from nets. 2000-07-25 02:55:13 +00:00
steve 53489e6abe Document ieee1364 issues. 2000-07-23 18:06:31 +00:00
steve 4f75d04a42 Document time scale in netlists. 2000-07-23 18:06:15 +00:00
steve 81dab9c572 Excessive assert. 2000-07-23 02:41:32 +00:00
steve 286cef19fb Parse and elaborate timescale to scopes. 2000-07-22 22:09:03 +00:00
steve 741b17245d Handle some edge cases during node scans. 2000-07-16 04:56:07 +00:00
steve 2a08824ae9 Detect muxing Vz as a bufufN. 2000-07-15 05:13:43 +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 8dd2fc7095 More detailed handling of exit status from commands. 2000-07-11 23:30:03 +00:00
steve c07cc005bd proper init method for bufz devices. 2000-07-11 23:08:33 +00:00
steve 79ca317c1d Better handle failures to build lexor_keyword.cc 2000-07-11 23:07:28 +00:00
steve b8946d4cb3 Add the dist_uniform function. 2000-07-08 22:41:07 +00:00
steve 8902645fa7 Allow set vpiIntVal on bitset type objects. 2000-07-08 22:40:07 +00:00
steve 9c12fcffe4 pass zero-delay values immediately. 2000-07-08 22:39:32 +00:00
steve 9b59001cf9 Eleminate reduction gate for 1-bit compares. 2000-07-08 04:59:20 +00:00
steve 18eb34921f Add support for non-constant delays in delay statements,
Support evaluating ! in constant expressions, and
 move some code from netlist.cc to net_proc.cc.
2000-07-07 04:53:53 +00:00
steve cdb3eb7e6b Connect all the l and r bits of a NE expression. 2000-07-06 18:13:24 +00:00
steve e152b91226 unop_not can take out width same as in width. 2000-07-06 18:12:28 +00:00
steve 056a3f7220 Allow unary operators in constant expressions. 2000-06-30 15:50:20 +00:00
steve 888360dd3b Handle errors from parser slightly differently. 2000-06-30 15:49:44 +00:00
steve 337eee7dcb Reduce result is OK in ~ operator. 2000-06-30 15:47:06 +00:00
steve de76c77820 Catch errors from compile that leave the low 8 bits empty. 2000-06-30 04:42:23 +00:00
steve 642e1bccd9 Use nexus type to get nexus name. 2000-06-28 18:38:54 +00:00
steve 1562784a48 Initialize memories as they are create. 2000-06-28 18:38:00 +00:00
steve 042724612e Handle delay_value_lists in simple paths. (Wen-jung Tseng) 2000-06-27 16:00:40 +00:00
steve 62d83e962a properly match unconnected_drive directive. (Wen-jung Tseng) 2000-06-27 04:36:29 +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
steve e52ada617e Get rid of useless next_link method. 2000-06-24 22:55:19 +00:00
steve f3384c7da5 expression scan uses tgt_ to get output files. 2000-06-24 16:40:46 +00:00
steve d94acc1c5c Update to final release. 2000-06-21 19:09:54 +00:00
steve 4febf5801b Handle width expansion of shift operators. 2000-06-18 03:29:52 +00:00
steve e52243a82d Up to rc2 in the file name. 2000-06-18 02:02:26 +00:00
steve db8cc7d98d Detect some hosts that do not support -rdynamic. 2000-06-16 19:00:06 +00:00
steve bec4a205ec Do not install bin/verilog. 2000-06-16 18:59:49 +00:00
steve a2d3a5aab0 Do not include bin/verilog in the product. 2000-06-16 18:59:07 +00:00
steve 9bc3a8f241 Solaris pkg files. 2000-06-16 18:58:45 +00:00
steve 8f64656984 Binary expressions as operands to system tasks. 2000-06-15 04:23:17 +00:00
steve 6f3153d703 Ignore more things in null target. 2000-06-14 20:29:39 +00:00
steve 80878e2e53 Support concatenation in parameter expressions. 2000-06-13 05:22:16 +00:00
steve 66ae567b25 Index in memory assign should be a NetExpr. 2000-06-13 03:24:48 +00:00
steve 413d852012 NetEParam supports dup_expr. 2000-06-12 03:57:10 +00:00
steve 8b03550a1e Fix subract of short value form long one. 2000-06-12 03:56:51 +00:00
steve 6329549938 Prepare for release candidate. 2000-06-10 17:51:40 +00:00
steve 6f9cc57e70 Current reality of what is supported. 2000-06-07 03:53:16 +00:00
steve 3d85c66b02 Do not install obsolete verilog script. 2000-06-07 03:52:55 +00:00
steve fcbbbfe3d6 Expand constants in its special case assignment. (Stephan Boettcher) 2000-06-06 02:32:45 +00:00
steve ea8bc7f419 Interpret the depth paramter of dumpvars. 2000-06-03 02:22:15 +00:00
steve 161fa9c4e7 Do not attach temporaries to scopes. 2000-06-03 02:13:43 +00:00
steve c2b134e7d6 Output signal of + is a temporary. 2000-06-03 02:13:15 +00:00
steve 9c1dc92d74 Parameters can be strings. 2000-06-01 02:31:39 +00:00
steve a674df662f The NetESignal shortcut cannot expand an rvalue. 2000-05-31 03:52:07 +00:00
steve c1c0168893 Globally merge redundant event objects. 2000-05-31 02:26:49 +00:00
steve 9c65596b1a typo: fix vpiReadVal to vpiRealVal 2000-05-31 02:15:43 +00:00
steve 503ed3276f typ vpiRealType. 2000-05-31 01:32:16 +00:00
steve 14d87e3e11 Typo saving third delay value in list. 2000-05-31 01:31:52 +00:00
steve fd09bc3e3e Merge similar probes within a module. 2000-05-27 19:33:23 +00:00
steve e0dcdf6b72 Handle wide conditions in ternary operator. 2000-05-26 05:26:11 +00:00
steve 0c62321402 Emin init code only once per nexus. 2000-05-25 06:02:12 +00:00
steve 1bde1b862d Optimize assignment from signals. 2000-05-25 01:45:35 +00:00
steve 8fc2dc2cd1 Better parsing of expressions lists will empty expressoins. 2000-05-23 16:03:13 +00:00
steve 092b1bded5 Add vpi numbers to the bits table. 2000-05-20 02:48:51 +00:00
steve b93415e8f1 Combine constants into a bit table. 2000-05-20 02:26:23 +00:00
steve 28df01b880 Add the integer modulus function. 2000-05-19 04:22:55 +00:00
steve 2f419f0e08 Catch part select of memories as an error. 2000-05-19 01:55:09 +00:00
steve d9eed14972 Accept different widths for add operands. 2000-05-19 01:43:16 +00:00
steve cc3d4c8231 Ternary operator handles bit sizes. 2000-05-18 20:35:08 +00:00
steve 38b4de87ad Overcautious assert in shift is removed. 2000-05-18 20:23:40 +00:00
steve 0f13af2ea1 Support writing scalars and vectors to signals. 2000-05-18 03:27:32 +00:00
steve a96fa80ccc Add the module option to iverilog. 2000-05-17 03:53:29 +00:00
steve 085c31d671 syn-rules.cc.output is generated. 2000-05-16 04:05:59 +00:00
steve 3676d66408 Module ports are really special PEIdent
expressions, because a name can be used
 many places in the port list.
2000-05-16 04:05:15 +00:00
steve addedf7231 Fix -f flag handling. 2000-05-14 19:41:52 +00:00
steve 562e4c28d2 Update to use iverilog. 2000-05-14 19:41:22 +00:00
steve 1e0e1a2b64 Add a demonstration of DFF initialization. 2000-05-14 19:41:08 +00:00
steve ea96c3ef66 Support initialization of FF Q value. 2000-05-14 17:55:04 +00:00
steve cca036c4a8 Make rules consistent with token stream. 2000-05-13 22:46:22 +00:00
steve 3c9902d93e Use yacc based synthesizer. 2000-05-13 20:55:47 +00:00
steve e5511fd0a7 Up to date support, and mention iverilog. 2000-05-13 20:55:15 +00:00
steve afdb76c929 Use iverilog command. 2000-05-13 20:54:48 +00:00
steve b44abcd481 Get rid of gverilog source. 2000-05-12 05:23:15 +00:00
steve c3282bfa6c NetCAssign needs to incr_eref its lval to lock it down. 2000-05-12 01:22:41 +00:00
steve 367db72c99 Add support for procedural continuous assignment. 2000-05-11 23:37:26 +00:00
steve 4f0b0cb8ce No need for nobufz. 2000-05-11 01:44:52 +00:00
steve d68339a96a Calculate the X output value from drive0 and drive1 2000-05-11 01:37:33 +00:00
steve 6021c7b192 Give strengths to logic and bufz devices. 2000-05-09 21:16:35 +00:00
steve d4bab8709b Remove test print. 2000-05-09 00:02:29 +00:00
steve 2f59918c74 Parameterize LD lib in C++ command line. 2000-05-09 00:02:13 +00:00
steve de1a7a0933 Deliver gate output strengths to the netlist. 2000-05-08 05:30:19 +00:00
steve e9742c662b no need for nobufz functor. 2000-05-08 05:29:43 +00:00
steve e81ce68e8c Use bufz to make assignments directional. 2000-05-08 05:28:29 +00:00
steve c98e4b25b3 Restore vvm_bufz to working condition. 2000-05-08 05:27:32 +00:00
steve c4d8ded269 non-blocking assignment to a bit select. 2000-05-07 21:17:21 +00:00
steve 35a2690d75 Properly elaborate repeat concatenations. 2000-05-07 20:48:14 +00:00
steve ca6631fdda Fix connection of Direction of LMP_CLSHIFT
to constant values. Remember to add a signal
 to the nexus and connect the receiver in vvm.
2000-05-07 19:40:26 +00:00
steve b28f258463 Import MCD support from Stephen Tell, and add
system function parameter support to the IVL core.
2000-05-07 18:20:07 +00:00
steve b90cda1f3f Carry strength values from Verilog source to the
pform and netlist for gates.

 Change vvm constants to use the driver_t to drive
 a constant value. This works better if there are
 multiple drivers on a signal.
2000-05-07 04:37:55 +00:00
steve ca2fd41bb6 Carry assignment strength to pform. 2000-05-06 15:41:56 +00:00
steve 43643ba98f Add the -I and -D switches to iverilog. 2000-05-05 01:07:42 +00:00
steve f847b9cfeb Tell ivlpp to generate line number directives. 2000-05-04 20:08:20 +00:00
steve fbe475ef7d Add infrastructure for system functions, move
$time to that structure and add $random.
2000-05-04 03:37:58 +00:00
steve f95b082339 More features of ivl available through iverilog. 2000-05-03 22:14:31 +00:00
steve 0a70a8a954 Allow ternary result to be padded to result width. 2000-05-03 21:21:36 +00:00
steve ed5e587cf1 Support named for in VPI. 2000-05-03 05:03:26 +00:00
steve 1db70a0c46 Move signal elaboration to a seperate pass. 2000-05-02 16:27:38 +00:00
steve 69612ceb73 Move memories to the NetScope object. 2000-05-02 03:13:30 +00:00
steve 8d8f1e2401 Move signal tables to the NetScope class. 2000-05-02 00:58:11 +00:00
steve b175e4aef7 Better inc and lib paths for iverilog. 2000-05-01 23:55:22 +00:00
522 changed files with 137249 additions and 22741 deletions
+15 -3
View File
@@ -2,14 +2,26 @@ lexor_keyword.cc
parse.h
parse.cc
parse.cc.output
parse.output
syn-rules.cc
syn-rules.cc.output
syn-rules.output
lexor.cc
iverilog-vpi
iverilog-vpi.pdf
iverilog-vpi.ps
ivl
ivl.exp
dep
configure
Makefile
verilog
gverilog
iverilog
check
check.cc
check.vvp
config.status
config.log
config.cache
autom4te.cache
config.h
_pli_types.h
dosify
+138
View File
@@ -0,0 +1,138 @@
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: Attrib.cc,v 1.6 2004/02/20 18:53:33 steve Exp $"
#endif
# include "config.h"
# include "Attrib.h"
# include <assert.h>
Attrib::Attrib()
{
nlist_ = 0;
list_ = 0;
}
Attrib::~Attrib()
{
delete[] list_;
}
const verinum& Attrib::attribute(perm_string key) const
{
for (unsigned idx = 0 ; idx < nlist_ ; idx += 1) {
if (key == list_[idx].key)
return list_[idx].val;
}
static const verinum null;
return null;
}
void Attrib::attribute(perm_string key, const verinum&value)
{
unsigned idx;
for (idx = 0 ; idx < nlist_ ; idx += 1) {
if (key == list_[idx].key) {
list_[idx].val = value;
return;
}
}
struct cell_*tmp = new struct cell_[nlist_+1];
for (idx = 0 ; idx < nlist_ ; idx += 1)
tmp[idx] = list_[idx];
tmp[nlist_].key = key;
tmp[nlist_].val = value;
nlist_ += 1;
delete[]list_;
list_ = tmp;
}
bool Attrib::has_compat_attributes(const Attrib&that) const
{
unsigned idx;
for (idx = 0 ; idx < that.nlist_ ; idx += 1) {
verinum tmp = attribute(that.list_[idx].key);
if (tmp != that.list_[idx].val)
return false;
}
return true;
}
unsigned Attrib::attr_cnt() const
{
return nlist_;
}
perm_string Attrib::attr_key(unsigned idx) const
{
assert(idx < nlist_);
return list_[idx].key;
}
const verinum& Attrib::attr_value(unsigned idx) const
{
assert(idx < nlist_);
return list_[idx].val;
}
/*
* $Log: Attrib.cc,v $
* Revision 1.6 2004/02/20 18:53:33 steve
* Addtrbute keys are perm_strings.
*
* Revision 1.5 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.4 2002/05/26 01:39:02 steve
* Carry Verilog 2001 attributes with processes,
* all the way through to the ivl_target API.
*
* Divide signal reference counts between rval
* and lval references.
*
* Revision 1.3 2002/05/23 03:08:50 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.2 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.1 2000/12/04 17:37:03 steve
* Add Attrib class for holding NetObj attributes.
*
*/
+90
View File
@@ -0,0 +1,90 @@
#ifndef __Attrib_H
#define __Attrib_H
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: Attrib.h,v 1.5 2004/02/20 18:53:33 steve Exp $"
#endif
# include "StringHeap.h"
# include "verinum.h"
/*
* This class keeps a map of key/value pairs. The map can be set from
* an STL map, or by setting individual mappings.
*/
class Attrib {
public:
Attrib();
~Attrib();
const verinum&attribute(perm_string key) const;
void attribute(perm_string key, const verinum&value);
bool has_compat_attributes(const Attrib&that) const;
/* Provide a means of iterating over the entries in the map. */
unsigned attr_cnt() const;
perm_string attr_key(unsigned idx) const;
const verinum& attr_value(unsigned idx) const;
private:
struct cell_ {
perm_string key;
verinum val;
};
unsigned nlist_;
struct cell_*list_;
private: // not implemented
Attrib(const Attrib&);
Attrib& operator= (const Attrib&);
};
/*
* $Log: Attrib.h,v $
* Revision 1.5 2004/02/20 18:53:33 steve
* Addtrbute keys are perm_strings.
*
* Revision 1.4 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.3 2002/05/26 01:39:02 steve
* Carry Verilog 2001 attributes with processes,
* all the way through to the ivl_target API.
*
* Divide signal reference counts between rval
* and lval references.
*
* Revision 1.2 2002/05/23 03:08:50 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.1 2000/12/04 17:37:03 steve
* Add Attrib class for holding NetObj attributes.
*
*/
#endif
+32 -4
View File
@@ -16,7 +16,7 @@ compilation tools you are using. Specifically, I need to know:
- Operating system and processor type,
- Compiler w/ version,
- Library version, and
- anything else you think relevent.
- anything else you think relevant.
Be aware that I do not have at my disposal a porting lab. I have the
alpha on my desk, and the Linux/Intel box with a logic analyzer and
@@ -104,12 +104,30 @@ module may not be needed as long as the ``-s <name>'' switch is
given.
So when you send a test case, ask yourself "Can poor overworked Steve
invoke the error without any Verilog other then what is included?" And
invoke the error without any Verilog other than what is included?" And
while we are at it, please place a copyright notice in your test
program and include a GPL license statement if you can. Your test
program may find its way into the test suite, and the notices will
make it all nice and legal.
RESEARCHING EXISTING/PAST BUGS, AND FILING REPORTS
The URL <http://www.icarus.com/cgi-bin/ivl-bugs> is the main bug
tracking system. Once you believe you have found a bug, you may browse
the bugs database for existing bugs that may be related to yours. You
might find that your bug has already been fixed in a later release or
snapshot. If that's the case, then you are set.
The bug database supports basic keyword searches, and you can
optionally limit your search to active bugs, or fixed bugs. You may
also browse the bug database, just to get an idea what is still
broken. You may for example find a related bug that explains your
symptom.
The root page of the bug report database describes how to submit your
completed bug report. You may submit it via the web form, or via
e-mail.
HOW TO SEND PATCHES
Bug reports with patches are very welcome, especially if they are
@@ -130,7 +148,7 @@ patch is for, I will ask for clarification before applying it.)
COPYRIGHT ISSUES
Icarus Verilog is Copyright (c) 1998-1999 Stephen Williams except
Icarus Verilog is Copyright (c) 1998-2003 Stephen Williams except
where otherwise noted. Minor patches are covered as derivative works
(or editorial comment or whatever the appropriate legal term is) and
folded into the rest of ivl. However, if a submission can reasonably
@@ -141,8 +159,18 @@ then falls under the "otherwise noted" category.
I must insist that any copyright material submitted for inclusion
include the GPL license notice as shown in the rest of the source.
$Id: BUGS.txt,v 1.2 1999/08/06 04:05:28 steve Exp $
$Id: BUGS.txt,v 1.5 2007/03/22 16:08:14 steve Exp $
$Log: BUGS.txt,v $
Revision 1.5 2007/03/22 16:08:14 steve
Spelling fixes from Larry
Revision 1.4 2003/02/19 04:36:31 steve
Notes on hte bug database.
Revision 1.3 2003/01/30 16:23:07 steve
Spelling fixes.
Revision 1.2 1999/08/06 04:05:28 steve
Handle scope of parameters.
+151
View File
@@ -0,0 +1,151 @@
/*
* Copyright (c) 2001 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: HName.cc,v 1.8 2007/06/02 03:42:12 steve Exp $"
#endif
# include "config.h"
# include "HName.h"
# include <iostream>
# include <string.h>
# include <stdlib.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
hname_t::hname_t()
{
number_ = INT_MIN;
}
hname_t::hname_t(perm_string text)
{
name_ = text;
number_ = INT_MIN;
}
hname_t::hname_t(perm_string text, int num)
{
name_ = text;
number_ = num;
}
hname_t::hname_t(const hname_t&that)
{
name_ = that.name_;
number_ = that.number_;
}
hname_t& hname_t::operator = (const hname_t&that)
{
name_ = that.name_;
number_ = that.number_;
return *this;
}
hname_t::~hname_t()
{
}
perm_string hname_t::peek_name(void) const
{
return name_;
}
bool hname_t::has_number() const
{
return number_ != INT_MIN;
}
int hname_t::peek_number() const
{
return number_;
}
bool operator < (const hname_t&l, const hname_t&r)
{
int cmp = strcmp(l.peek_name(), r.peek_name());
if (cmp < 0) return true;
if (cmp > 0) return false;
if (l.has_number() && r.has_number())
return l.peek_number() < r.peek_number();
else
return false;
}
bool operator == (const hname_t&l, const hname_t&r)
{
if (l.peek_name() == r.peek_name()) {
if (l.has_number() && r.has_number())
return l.peek_number() == r.peek_number();
else
return true;
}
return false;
}
bool operator != (const hname_t&l, const hname_t&r)
{ return ! (l==r); }
ostream& operator<< (ostream&out, const hname_t&that)
{
if (that.peek_name() == 0) {
out << "";
return out;
}
out << that.peek_name();
if (that.has_number())
out << "[" << that.peek_number() << "]";
return out;
}
/*
* $Log: HName.cc,v $
* Revision 1.8 2007/06/02 03:42:12 steve
* Properly evaluate scope path expressions.
*
* Revision 1.7 2007/05/16 19:12:33 steve
* Fix hname_t use of space for 1 perm_string.
*
* Revision 1.6 2007/04/26 03:06:21 steve
* Rework hname_t to use perm_strings.
*
* Revision 1.5 2002/11/02 03:27:52 steve
* Allow named events to be referenced by
* hierarchical names.
*
* Revision 1.4 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.3 2002/01/05 04:36:06 steve
* include malloc.h only when available.
*
* Revision 1.2 2001/12/18 04:52:45 steve
* Include config.h for namespace declaration.
*
* Revision 1.1 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
*/
+99
View File
@@ -0,0 +1,99 @@
#ifndef __HName_H
#define __HName_H
/*
* Copyright (c) 2001-2007 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: HName.h,v 1.7 2007/06/02 03:42:12 steve Exp $"
#endif
# include <iostream>
# include "StringHeap.h"
#ifdef __GNUC__
#if __GNUC__ > 2
using namespace std;
#endif
#endif
/*
* This class represents a component of a Verilog hierarchical name. A
* hierarchical component contains a name string (prepresented here
* with a perm_string) and an optional signed number. This signed
* number is used if the scope is part of an array, for example an
* array of module instances or a loop generated scope.
*/
class hname_t {
public:
hname_t ();
explicit hname_t (perm_string text);
explicit hname_t (perm_string text, int num);
hname_t (const hname_t&that);
~hname_t();
hname_t& operator= (const hname_t&);
// Return the string part of the hname_t.
perm_string peek_name(void) const;
bool has_number() const;
int peek_number() const;
private:
perm_string name_;
// If the number is anything other then INT_MIN, then this is
// the numeric part of the name. Otherwise, it is not part of
// the name at all.
int number_;
private: // not implemented
};
extern bool operator < (const hname_t&, const hname_t&);
extern bool operator == (const hname_t&, const hname_t&);
extern bool operator != (const hname_t&, const hname_t&);
extern ostream& operator<< (ostream&, const hname_t&);
/*
* $Log: HName.h,v $
* Revision 1.7 2007/06/02 03:42:12 steve
* Properly evaluate scope path expressions.
*
* Revision 1.6 2007/05/16 19:12:33 steve
* Fix hname_t use of space for 1 perm_string.
*
* Revision 1.5 2007/04/26 03:06:21 steve
* Rework hname_t to use perm_strings.
*
* Revision 1.4 2002/11/02 03:27:51 steve
* Allow named events to be referenced by
* hierarchical names.
*
* Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.2 2002/06/14 03:25:51 steve
* Compiler portability.
*
* Revision 1.1 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
*/
#endif
+78
View File
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: LineInfo.cc,v 1.4 2003/01/17 05:49:03 steve Exp $"
#endif
# include "config.h"
# include "LineInfo.h"
# include <sstream>
LineInfo::LineInfo()
: file_(0), lineno_(0)
{
}
LineInfo::~LineInfo()
{
}
string LineInfo::get_line() const
{
ostringstream buf;
buf << (file_? file_ : "") << ":" << lineno_;
string res = buf.str();
return res;
}
void LineInfo::set_line(const LineInfo&that)
{
file_ = that.file_;
lineno_ = that.lineno_;
}
void LineInfo::set_file(const char*f)
{
file_ = f;
}
void LineInfo::set_lineno(unsigned n)
{
lineno_ = n;
}
/*
* $Log: LineInfo.cc,v $
* Revision 1.4 2003/01/17 05:49:03 steve
* Use stringstream in place of sprintf.
*
* Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.2 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.1 2000/11/30 17:31:42 steve
* Change LineInfo to store const C strings.
*
*/
+32 -36
View File
@@ -18,62 +18,58 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: LineInfo.h,v 1.4 2000/02/23 02:56:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: LineInfo.h,v 1.8 2005/06/14 19:13:43 steve Exp $"
#endif
# include <cstdio>
# include <string>
using namespace std;
/*
* This class holds line information for an internal object.
*
* Note that the file names are C-style strings that are allocated by
* the lexor (which parses the line directives) and are never
* deallocated. We can therefore safely store the pointer and never
* delete the string, even if LineInfo objects are destroyed.
*/
class LineInfo {
public:
LineInfo() : lineno_(0) { }
LineInfo();
~LineInfo();
string get_line() const
{ char buf[8];
sprintf(buf, "%u", lineno_);
return file_ + ":" + buf;
}
string get_line() const;
void set_line(const LineInfo&that)
{ file_ = that.file_;
lineno_ = that.lineno_;
}
void set_line(const LineInfo&that);
void set_file(const string&f) { file_ = f; }
void set_lineno(unsigned n) { lineno_ = n; }
void set_file(const char*f);
void set_lineno(unsigned n);
private:
string file_;
const char* file_;
unsigned lineno_;
};
/*
* $Log: LineInfo.h,v $
* Revision 1.8 2005/06/14 19:13:43 steve
* gcc3/4 compile errors.
*
* Revision 1.7 2003/01/17 05:49:03 steve
* Use stringstream in place of sprintf.
*
* Revision 1.6 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.5 2000/11/30 17:31:42 steve
* Change LineInfo to store const C strings.
*
* Revision 1.4 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
* Revision 1.3 1999/02/15 02:06:15 steve
* Elaborate gate ranges.
*
* Revision 1.2 1999/02/01 00:26:48 steve
* Carry some line info to the netlist,
* Dump line numbers for processes.
* Elaborate prints errors about port vector
* width mismatch
* Emit better handles null statements.
*
* Revision 1.1 1999/01/25 05:45:56 steve
* Add the LineInfo class to carry the source file
* location of things. PGate, Statement and PProcess.
*
* elaborate handles module parameter mismatches,
* missing or incorrect lvalues for procedural
* assignment, and errors are propogated to the
* top of the elaboration call tree.
*
* Attach line numbers to processes, gates and
* assignment statements.
*
*/
#endif
+206 -91
View File
@@ -3,9 +3,7 @@
# and/or modify it in source code form under the terms of the GNU
# Library General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version. In order to redistribute the software in
# binary form, you will need a Picture Elements Binary Software
# License.
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,23 +16,33 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.48 2000/04/28 16:50:53 steve Exp $"
#ident "$Id: Makefile.in,v 1.181 2007/05/24 04:07:11 steve Exp $"
#
#
SHELL = /bin/sh
VERSION = 0.3PRE
# This version string is only used in the version message printed
# by the compiler. It reflects the assigned version number for the
# product as a whole. Most components also print the CVS Name: token
# in order to get a more automatic version stamp as well.
VERSION = 0.9.devel
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
SUBDIRS = @subdirs@
VPATH = $(srcdir)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
mandir = @mandir@
includedir = $(prefix)/include
libdir64 = @libdir64@
dllib=@DLLIB@
CC = @CC@
CXX = @CXX@
@@ -42,126 +50,233 @@ INSTALL = @INSTALL@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
STRIP = @STRIP@
LEX = @LEX@
YACC = @YACC@
CPPFLAGS = @CPPFLAGS@ @DEFS@
CXXFLAGS = @CXXFLAGS@ -I$(srcdir)
LDFLAGS = @LDFLAGS@
CPPFLAGS = @ident_support@ @DEFS@ -I. -I$(srcdir) @CPPFLAGS@
CXXFLAGS = -Wall @CXXFLAGS@
PICFLAGS = @PICFLAG@
LDFLAGS = @rdynamic@ @LDFLAGS@
all: ivl verilog gverilog iverilog
cd vpi ; $(MAKE) all
cd vvm ; $(MAKE) all
cd ivlpp ; $(MAKE) all
all: dep ivl@EXEEXT@
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done
for dir in ivlpp ; \
do (cd $$dir ; $(MAKE) $@); done
cd driver ; $(MAKE) VERSION=$(VERSION) $@
# In the windows world, the installer will need a dosify program to
# dosify text files.
ifeq (@MING32@,yes)
all: dep dosify.exe
dosify.exe: dosify.c
$(CC) -o dosify.exe dosify.c
endif
# This rule rules the compiler in the trivial hello.vl program to make
# sure the basics were compiled properly.
check: all
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) check); done
test -r check.conf || cp $(srcdir)/check.conf .
driver/iverilog -B. -BPivlpp -tcheck -ocheck.vvp $(srcdir)/examples/hello.vl
vvp/vvp -M- -M./vpi ./check.vvp | grep 'Hello, World'
clean:
rm -f *.o parse.cc parse.cc.output parse.h dep/*.d lexor.cc verilog
cd vpi ; $(MAKE) clean
cd vvm ; $(MAKE) clean
cd ivlpp ; $(MAKE) clean
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done
for dir in vpi ivlpp tgt-verilog tgt-pal driver driver-vpi; \
do (cd $$dir ; $(MAKE) $@); done
rm -f *.o parse.cc parse.cc.output parse.h lexor.cc
rm -f ivl.exp iverilog-vpi.pdf iverilog-vpi.ps parse.output
rm -f syn-rules.output dosify.exe ivl@EXEEXT@ check.vvp
rm -f lexor_keyword.cc libivl.a libvpi.a iverilog-vpi syn-rules.cc*
rm -rf dep
distclean: clean
rm -f vpi/Makefile
rm -f vvm/Makefile
rm -f ivlpp/Makefile
rm -f config.status config.cache config.log
rm -f Makefile
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done
for dir in vpi ivlpp tgt-verilog tgt-pal driver driver-vpi; \
do (cd $$dir ; $(MAKE) $@); done
rm -f Makefile config.status config.log config.cache config.h
rm -f _pli_types.h
TT = t-null.o t-verilog.o t-vvm.o t-xnf.o
FF = nobufz.o nodangle.o propinit.o synth.o xnfio.o
TT = t-dll.o t-dll-api.o t-dll-expr.o t-dll-proc.o
FF = cprop.o nodangle.o synth.o synth2.o syn-rules.o
O = main.o cprop.o design_dump.o dup_expr.o elaborate.o elab_expr.o \
elab_net.o elab_pexpr.o elab_scope.o emit.o eval.o eval_tree.o \
expr_synth.o functor.o lexor.o lexor_keyword.o link_const.o \
mangle.o netlist.o \
net_design.o net_event.o net_scope.o net_udp.o nexus_from_link.o \
pad_to_width.o \
parse.o parse_misc.o pform.o pform_dump.o \
set_width.o \
verinum.o verireal.o target.o targets.o util.o Module.o PDelays.o PEvent.o \
PExpr.o PGate.o \
PTask.o PFunction.o PWire.o Statement.o \
O = main.o async.o design_dump.o dup_expr.o elaborate.o elab_expr.o \
elab_lval.o elab_net.o elab_pexpr.o elab_scope.o \
elab_sig.o emit.o eval.o eval_attrib.o \
eval_tree.o expr_synth.o functor.o lexor.o lexor_keyword.o link_const.o \
load_module.o netlist.o netmisc.o net_assign.o \
net_design.o net_event.o net_expr.o net_force.o net_func.o \
net_link.o net_modulo.o net_nex_input.o net_nex_output.o \
net_proc.o net_scope.o net_udp.o pad_to_width.o \
parse.o parse_misc.o pform.o pform_dump.o pform_types.o \
set_width.o symbol_search.o sync.o sys_funcs.o \
verinum.o verireal.o target.o targets.o \
Attrib.o HName.o LineInfo.o Module.o PDelays.o PEvent.o \
PExpr.o PGate.o PGenerate.o PSpec.o \
PTask.o PUdp.o PFunction.o PWire.o Statement.o StringHeap.o \
$(FF) $(TT)
Makefile: Makefile.in config.status
Makefile: Makefile.in config.h.in config.status
./config.status
# Make the actual verilog program from the script template. This
# simply invloves editing the substitution strings in the script into
# the configured copy.
tmp1 = bindir
tmp2 = libdir
tmp3 = includedir
tmp4 = CXX
verilog: $(srcdir)/verilog.sh
sed -e 's;@$(tmp1)@;@bindir@;' \
-e 's;@$(tmp2)@;@libdir@;' \
-e 's;@$(tmp3)@;@includedir@;' \
-e 's;@dllib@;@DLLIB@;' \
-e 's;@$(tmp4)@;@CXX@;' < $< > $@
ivl: $O
$(CXX) $(CXXFLAGS) -o ivl $O
ifeq (@WIN32@,yes)
# Under Windows (mingw) I need to make the ivl.exe in two steps.
# The first step makes an ivl.exe that dlltool can use to make an
# export and import library, and the last link makes a, ivl.exe
# that really exports the things that the import library imports.
ivl@EXEEXT@: $O ivl.def
$(CXX) -o ivl@EXEEXT@ $O $(dllib) @EXTRALIBS@
dlltool --dllname ivl@EXEEXT@ --def ivl.def \
--output-lib libivl.a --output-exp ivl.exp
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ ivl.exp $O $(dllib) @EXTRALIBS@
else
ivl@EXEEXT@: $O
$(CXX) $(LDFLAGS) -o ivl@EXEEXT@ $O $(dllib)
endif
iverilog: iverilog.c
$(CC) $(CPPFLAGS) -o iverilog -DIVL_ROOT='"@libdir@/ivl"' iverilog.c
ifeq (@MINGW32@,yes)
SUBDIRS += driver-vpi
else
all: dep iverilog-vpi
%.o dep/%.d: %.cc
@[ -d dep ] || mkdir dep
iverilog-vpi: iverilog-vpi.sh
sed -e 's;@SHARED@;@shared@;' -e 's;@PIC@;@PICFLAG@;' \
-e 's;@IVCC@;$(CC);' \
-e 's;@IVCXX@;$(CXX);' \
-e 's;@IVCFLAGS@;$(CXXFLAGS);' \
-e 's;@INCLUDEDIR@;@includedir@;' \
-e 's;@LIBDIR64@;@libdir64@;' \
-e 's;@VPIDIR1@;@vpidir1@;' -e 's;@VPIDIR2@;@vpidir2@;' \
-e 's;@LIBDIR@;@libdir@;' $< > $@
chmod +x $@
endif
dep:
mkdir dep
%.o: %.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -c $< -o $*.o
mv $*.d dep/$*.d
lexor.o dep/lexor.d: lexor.cc parse.h
lexor.o: lexor.cc parse.h
parse.o dep/parse.d: parse.cc
parse.o: parse.cc
parse.h parse.cc: $(srcdir)/parse.y
bison --verbose -t -p VL -d $(srcdir)/parse.y -o parse.cc
mv parse.cc.h parse.h
parse.cc parse.h: $(srcdir)/parse.y
$(YACC) --verbose -t -p VL -d -o parse.cc $(srcdir)/parse.y
mv parse.cc.h parse.h 2>/dev/null || mv parse.hh parse.h
syn-rules.cc: $(srcdir)/syn-rules.y
$(YACC) --verbose -p syn_ -o syn-rules.cc $(srcdir)/syn-rules.y
lexor.cc: $(srcdir)/lexor.lex
flex -PVL -s -olexor.cc $(srcdir)/lexor.lex
$(LEX) -PVL -s -olexor.cc $(srcdir)/lexor.lex
lexor_keyword.o dep/lexor_keyword.d: lexor_keyword.cc
lexor_keyword.o: lexor_keyword.cc parse.h
lexor_keyword.cc: lexor_keyword.gperf
gperf -o -i 7 -C -k 1-3,$$ -L ANSI-C -H keyword_hash -N check_identifier -t lexor_keyword.gperf > lexor_keyword.cc
gperf -o -i 7 -C -k 1-3,$$ -L ANSI-C -H keyword_hash -N check_identifier -t $(srcdir)/lexor_keyword.gperf > lexor_keyword.cc || (rm -f lexor_keyword.cc ; false)
iverilog-vpi.ps: $(srcdir)/iverilog-vpi.man
man -t $(srcdir)/iverilog-vpi.man > iverilog-vpi.ps
install: all installdirs $(bindir)/verilog $(bindir)/iverilog $(libdir)/ivl/ivl $(mandir)/man1/verilog.1 $(mandir)/man1/iverilog.1
cd vpi ; $(MAKE) install
cd vvm ; $(MAKE) install
cd ivlpp ; $(MAKE) install
iverilog-vpi.pdf: iverilog-vpi.ps
ps2pdf iverilog-vpi.ps iverilog-vpi.pdf
$(bindir)/verilog: ./verilog
$(INSTALL_SCRIPT) ./verilog $(bindir)/verilog
ifeq (@MING32@,yes)
INSTALL_DOC = $(prefix)/iverilog-vpi.pdf $(mandir)/man1/iverilog-vpi.1
INSTALL_DOCDIR = $(mandir)/man1
all: dep iverilog-vpi.pdf
else
INSTALL_DOC = $(mandir)/man1/iverilog-vpi.1
INSTALL_DOCDIR = $(mandir)/man1
endif
$(bindir)/iverilog: ./iverilog
$(INSTALL_PROGRAM) ./iverilog $(bindir)/iverilog
ifeq (@MINGW32@,yes)
WIN32_INSTALL = $(prefix)/hello.vl $(prefix)/sqrt.vl $(prefix)/sqrt-virtex.v $(prefix)/QUICK_START.txt
else
WIN32_INSTALL = $(bindir)/iverilog-vpi
endif
$(libdir)/ivl/ivl: ./ivl
$(INSTALL_PROGRAM) ./ivl $(libdir)/ivl/ivl
$(STRIP) $(libdir)/ivl/ivl
XNF_INSTALL = $(libdir)/ivl/xnf.conf $(libdir)/ivl/xnf-s.conf
$(mandir)/man1/verilog.1: $(srcdir)/verilog.1
$(INSTALL_DATA) $(srcdir)/verilog.1 $(mandir)/man1/verilog.1
install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(includedir)/ivl_target.h $(includedir)/_pli_types.h $(includedir)/vpi_user.h $(includedir)/acc_user.h $(includedir)/veriuser.h $(WIN32_INSTALL) $(INSTALL_DOC)
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done
for dir in vpi ivlpp driver; \
do (cd $$dir ; $(MAKE) $@); done
$(mandir)/man1/iverilog.1: $(srcdir)/iverilog.man
$(INSTALL_DATA) $(srcdir)/iverilog.man $(mandir)/man1/iverilog.1
$(bindir)/iverilog-vpi: ./iverilog-vpi
$(INSTALL_SCRIPT) ./iverilog-vpi $(bindir)/iverilog-vpi
$(libdir)/ivl/ivl@EXEEXT@: ./ivl@EXEEXT@
$(INSTALL_PROGRAM) ./ivl@EXEEXT@ $(libdir)/ivl/ivl@EXEEXT@
$(libdir)/ivl/xnf-s.conf: $(srcdir)/xnf-s.conf
$(INSTALL_DATA) $(srcdir)/xnf-s.conf $(libdir)/ivl/xnf-s.conf
$(libdir)/ivl/xnf.conf: $(srcdir)/xnf.conf
$(INSTALL_DATA) $(srcdir)/xnf.conf $(libdir)/ivl/xnf.conf
$(includedir)/ivl_target.h: $(srcdir)/ivl_target.h
$(INSTALL_DATA) $(srcdir)/ivl_target.h $(includedir)/ivl_target.h
$(includedir)/_pli_types.h: _pli_types.h
$(INSTALL_DATA) $< $(includedir)/_pli_types.h
$(includedir)/vpi_user.h: $(srcdir)/vpi_user.h
$(INSTALL_DATA) $(srcdir)/vpi_user.h $(includedir)/vpi_user.h
$(includedir)/acc_user.h: $(srcdir)/acc_user.h
$(INSTALL_DATA) $(srcdir)/acc_user.h $(includedir)/acc_user.h
$(includedir)/veriuser.h: $(srcdir)/veriuser.h
$(INSTALL_DATA) $(srcdir)/veriuser.h $(includedir)/veriuser.h
$(mandir)/man1/iverilog-vpi.1: $(srcdir)/iverilog-vpi.man
$(INSTALL_DATA) $(srcdir)/iverilog-vpi.man $(mandir)/man1/iverilog-vpi.1
$(prefix)/iverilog-vpi.pdf: iverilog-vpi.pdf
$(INSTALL_DATA) iverilog-vpi.pdf $(prefix)/iverilog-vpi.pdf
# In windows installations, put a few examples and the quick_start
# into the destination directory.
ifeq (@MINGW32@,yes)
$(prefix)/hello.vl: $(srcdir)/examples/hello.vl
./dosify.exe $(srcdir)/examples/hello.vl tmp.vl
mv tmp.vl $(prefix)/hello.vl
$(prefix)/sqrt.vl: $(srcdir)/examples/sqrt.vl
./dosify.exe $(srcdir)/examples/sqrt.vl tmp.vl
mv tmp.vl $(prefix)/sqrt.vl
$(prefix)/sqrt-virtex.v: $(srcdir)/examples/sqrt-virtex.v
./dosify.exe $(srcdir)/examples/sqrt-virtex.v tmp.vl
mv tmp.vl $(prefix)/sqrt-virtex.v
$(prefix)/QUICK_START.txt: $(srcdir)/QUICK_START.txt
./dosify.exe $(srcdir)/QUICK_START.txt tmp.txt
mv tmp.txt $(prefix)/QUICK_START.txt
endif
installdirs: mkinstalldirs
$(srcdir)/mkinstalldirs $(bindir) $(libdir)/ivl $(mandir)/man1
$(srcdir)/mkinstalldirs $(bindir) $(includedir) $(libdir)/ivl \
$(mandir) $(mandir)/man1
uninstall:
rm -f $(libdir)/ivl/ivl
rm -f $(bindir)/verilog
rm -f $(bindir)/gverilog
rm -f $(bindir)/iverilog
rm -f $(mandir)/man1/verilog.1
rm -f $(mandir)/man1/iverilog.1
cd vpi ; $(MAKE) uninstall
cd vvm ; $(MAKE) uninstall
cd ivlpp ; $(MAKE) uninstall
for dir in $(SUBDIRS); do (cd $$dir ; $(MAKE) $@); done
for dir in vpi ivlpp driver; \
do (cd $$dir ; $(MAKE) $@); done
for f in xnf.conf xnf-s.conf ivl@EXEEXT@; \
do rm -f $(libdir)/ivl/$$f; done
-rmdir $(libdir)/ivl
for f in verilog iverilog-vpi gverilog@EXEEXT@; \
do rm -f $(bindir)/$$f; done
for f in ivl_target.h vpi_user.h _pli_types.h acc_user.h veriuser.h; \
do rm -f $(includedir)/$$f; done
rm -f $(mandir)/man1/iverilog-vpi.1 $(prefix)/iverilog-vpi.pdf
-include $(patsubst %.o, dep/%.d, $O)
-include $(patsubst %.o, dep/%.d, vpithunk.o)
+99 -44
View File
@@ -16,40 +16,27 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: Module.cc,v 1.11 2000/03/12 17:09:40 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: Module.cc,v 1.27 2007/05/24 04:07:11 steve Exp $"
#endif
# include "config.h"
# include "Module.h"
# include "PGate.h"
# include "PWire.h"
# include <assert.h>
Module::Module(const string&name, const svector<Module::port_t*>*pp)
: name_(name)
/* n is a permallocated string. */
Module::Module(perm_string n)
: name_(n)
{
if (pp) {
// Save the list of ports, then scan the list to make
// the implicit wires. Add those wires to the wire map.
ports_ = *pp;
for (unsigned idx = 0 ; idx < ports_.count() ; idx += 1) {
port_t*cur = ports_[idx];
if (cur == 0)
continue;
library_flag = false;
default_nettype = NetNet::NONE;
}
// The port can actually be a list of wires, to
// remember to scan the set. Also note the case
// where a wire may be connected to multiple
// ports, and reuse the link if that happens.
for (unsigned jdx = 0; jdx < cur->wires.count(); jdx += 1) {
PWire*tmp = add_wire(cur->wires[jdx]);
if (tmp != cur->wires[jdx]) {
delete cur->wires[jdx];
cur->wires[jdx] = tmp;
}
}
}
}
Module::~Module()
{
}
void Module::add_gate(PGate*gate)
@@ -57,19 +44,19 @@ void Module::add_gate(PGate*gate)
gates_.push_back(gate);
}
void Module::add_task(const string&name, PTask*task)
void Module::add_task(perm_string name, PTask*task)
{
tasks_[name] = task;
}
void Module::add_function(const string &name, PFunction *func)
void Module::add_function(perm_string name, PFunction *func)
{
funcs_[name] = func;
}
PWire* Module::add_wire(PWire*wire)
{
PWire*&ep = wires_[wire->name()];
PWire*&ep = wires_[wire->path()];
if (ep) return ep;
assert(ep == 0);
@@ -84,36 +71,56 @@ void Module::add_behavior(PProcess*b)
unsigned Module::port_count() const
{
return ports_.count();
return ports.count();
}
const svector<PWire*>& Module::get_port(unsigned idx) const
/*
* Return the array of PEIdent object that are at this port of the
* module. If the port is internally unconnected, return an empty
* array.
*/
const svector<PEIdent*>& Module::get_port(unsigned idx) const
{
assert(idx < ports_.count());
return ports_[idx]->wires;
assert(idx < ports.count());
static svector<PEIdent*> zero;
if (ports[idx])
return ports[idx]->expr;
else
return zero;
}
unsigned Module::find_port(const string&name) const
unsigned Module::find_port(const char*name) const
{
assert(name != "");
for (unsigned idx = 0 ; idx < ports_.count() ; idx += 1)
if (ports_[idx]->name == name)
for (unsigned idx = 0 ; idx < ports.count() ; idx += 1) {
if (ports[idx] == 0) {
/* It is possible to have undeclared ports. These
are ports that are skipped in the declaration,
for example like so: module foo(x ,, y); The
port between x and y is unnamed and thus
inaccessible to binding by name. */
continue;
}
assert(ports[idx]);
if (ports[idx]->name == name)
return idx;
}
return ports_.count();
return ports.count();
}
PWire* Module::get_wire(const string&name) const
PWire* Module::get_wire(const pform_name_t&name) const
{
map<string,PWire*>::const_iterator obj = wires_.find(name);
map<pform_name_t,PWire*>::const_iterator obj = wires_.find(name);
if (obj == wires_.end())
return 0;
else
return (*obj).second;
}
PGate* Module::get_gate(const string&name)
PGate* Module::get_gate(perm_string name)
{
for (list<PGate*>::iterator cur = gates_.begin()
; cur != gates_.end()
@@ -126,11 +133,6 @@ PGate* Module::get_gate(const string&name)
return 0;
}
const map<string,PWire*>& Module::get_wires() const
{
return wires_;
}
const list<PGate*>& Module::get_gates() const
{
return gates_;
@@ -144,6 +146,59 @@ const list<PProcess*>& Module::get_behaviors() const
/*
* $Log: Module.cc,v $
* Revision 1.27 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.26 2007/04/19 02:52:53 steve
* Add support for -v flag in command file.
*
* Revision 1.25 2004/10/04 01:10:51 steve
* Clean up spurious trailing white space.
*
* Revision 1.24 2004/06/13 04:56:53 steve
* Add support for the default_nettype directive.
*
* Revision 1.23 2004/02/20 06:22:56 steve
* parameter keys are per_strings.
*
* Revision 1.22 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.21 2003/04/02 03:00:14 steve
* Cope with empty module ports while binding by name.
*
* Revision 1.20 2003/03/06 04:37:12 steve
* lex_strings.add module names earlier.
*
* Revision 1.19 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.18 2002/05/19 23:37:28 steve
* Parse port_declaration_lists from the 2001 Standard.
*
* Revision 1.17 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.16 2001/10/20 05:21:51 steve
* Scope/module names are char* instead of string.
*
* Revision 1.15 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.14 2000/11/15 20:31:05 steve
* Fix warning about temporaries.
*
* Revision 1.13 2000/11/05 06:05:59 steve
* Handle connectsion to internally unconnected modules (PR#38)
*
* Revision 1.12 2000/05/16 04:05:15 steve
* Module ports are really special PEIdent
* expressions, because a name can be used
* many places in the port list.
*
* Revision 1.11 2000/03/12 17:09:40 steve
* Support localparam.
*
+89 -91
View File
@@ -1,7 +1,7 @@
#ifndef __Module_H
#define __Module_H
/*
* Copyright (c) 1998-2000 Stephen Williams ([email protected])
* Copyright (c) 1998-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,18 +18,25 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: Module.h,v 1.17 2000/04/01 19:31:57 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: Module.h,v 1.43 2007/05/24 04:07:11 steve Exp $"
#endif
# include <list>
# include <map>
# include "svector.h"
# include "StringHeap.h"
# include "HName.h"
# include "named.h"
# include <string>
# include "LineInfo.h"
# include "netlist.h"
# include "pform_types.h"
class PEvent;
class PExpr;
class PEIdent;
class PGate;
class PGenerate;
class PSpecPath;
class PTask;
class PFunction;
class PWire;
@@ -43,7 +50,7 @@ class NetScope;
* therefore the handle for grasping the described circuit.
*/
class Module {
class Module : public LineInfo {
/* The module ports are in general a vector of port_t
objects. Each port has a name and an ordered list of
@@ -52,27 +59,47 @@ class Module {
the port. */
public:
struct port_t {
string name;
svector<PWire*>wires;
port_t(int c=0) : wires(c) { }
perm_string name;
svector<PEIdent*> expr;
};
public:
explicit Module(const string&name, const svector<port_t*>*);
/* The name passed here is the module name, not the instance
name. This make must be a permallocated string. */
explicit Module(perm_string name);
~Module();
/* Initially false. This is set to true if the module has been
declared as a library module. This makes the module
ineligible for being chosen as an implicit root. It has no
other effect. */
bool library_flag;
NetNet::Type default_nettype;
/* The module has parameters that are evaluated when the
module is elaborated. During parsing, I put the parameters
into this map. */
map<string,PExpr*>parameters;
map<string,PExpr*>localparams;
struct param_expr_t {
PExpr*expr;
PExpr*msb;
PExpr*lsb;
bool signed_flag;
};
map<perm_string,param_expr_t>parameters;
map<perm_string,param_expr_t>localparams;
/* specparams are simpler then other params, in that they have
no type information. They are merely constant
expressions. */
map<perm_string,PExpr*>specparams;
/* The module also has defparam assignments which don't create
new parameters within the module, but may be used to set
values within this module (when instantiated) or in other
instantiated modules. */
map<string,PExpr*>defparms;
map<pform_name_t,PExpr*>defparms;
/* Parameters may be overridden at instantiation time;
the overrides do not contain explicit parameter names,
@@ -80,13 +107,32 @@ class Module {
appear in the instantiated module. Therefore a
list of names in module-order is needed to pass from
a parameter-index to its name. */
list<string> param_names;
list<perm_string> param_names;
/* This is an array of port descriptors, which is in turn a
named array of PEident pointers. */
svector<port_t*> ports;
/* Keep a table of named events declared in the module. */
map<string,PEvent*>events;
map<perm_string,PEvent*>events;
map<perm_string,PExpr*> attributes;
const string&get_name() const { return name_; }
/* These are the timescale for this module. The default is
set by the `timescale directive. */
int time_unit, time_precision;
/* The module has a list of genvars that may be used in
various generate schemes. */
list<perm_string> genvars;
/* the module has a list of generate schemes that appear in
the module definition. These are used at elaboration time. */
list<PGenerate*> generate_schemes;
list<PSpecPath*> specify_paths;
perm_string mod_name() const { return name_; }
void add_gate(PGate*gate);
@@ -96,36 +142,37 @@ class Module {
PWire* add_wire(PWire*wire);
void add_behavior(PProcess*behave);
void add_task(const string&name, PTask*def);
void add_function(const string&name, PFunction*def);
void add_task(perm_string name, PTask*def);
void add_function(perm_string name, PFunction*def);
unsigned port_count() const;
const svector<PWire*>& get_port(unsigned idx) const;
unsigned find_port(const string&) const;
const svector<PEIdent*>& get_port(unsigned idx) const;
unsigned find_port(const char*name) const;
// Find a wire by name. This is used for connecting gates to
// existing wires, etc.
PWire* get_wire(const string&name) const;
PGate* get_gate(const string&name);
PWire* get_wire(const pform_name_t&name) const;
PGate* get_gate(perm_string name);
const map<string,PWire*>& get_wires() const;
const list<PGate*>& get_gates() const;
const list<PProcess*>& get_behaviors() const;
void dump(ostream&out) const;
bool elaborate(Design*, NetScope*scope) const;
bool elaborate_scope(Design*, NetScope*scope) const;
typedef map<perm_string,NetExpr*> replace_t;
bool elaborate_scope(Design*, NetScope*scope, const replace_t&rep) const;
bool elaborate_sig(Design*, NetScope*scope) const;
private:
const string name_;
perm_string name_;
svector<port_t*> ports_;
map<string,PWire*> wires_;
map<pform_name_t,PWire*> wires_;
list<PGate*> gates_;
list<PProcess*> behaviors_;
map<string,PTask*> tasks_;
map<string,PFunction*> funcs_;
map<perm_string,PTask*> tasks_;
map<perm_string,PFunction*> funcs_;
private: // Not implemented
Module(const Module&);
@@ -135,72 +182,23 @@ class Module {
/*
* $Log: Module.h,v $
* Revision 1.17 2000/04/01 19:31:57 steve
* Named events as far as the pform.
* Revision 1.43 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.16 2000/03/12 17:09:40 steve
* Support localparam.
* Revision 1.42 2007/04/19 02:52:53 steve
* Add support for -v flag in command file.
*
* Revision 1.15 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
* in a separate pass over the pform. Once the scopes
* are generated, I can process overrides and evalutate
* paremeters before elaboration begins.
* Revision 1.41 2006/09/23 04:57:19 steve
* Basic support for specify timing.
*
* Revision 1.14 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
* Revision 1.40 2006/04/10 00:37:42 steve
* Add support for generate loops w/ wires and gates.
*
* Revision 1.13 2000/01/09 20:37:57 steve
* Careful with wires connected to multiple ports.
*
* Revision 1.12 2000/01/09 05:50:48 steve
* Support named parameter override lists.
*
* Revision 1.11 1999/12/11 05:45:41 steve
* Fix support for attaching attributes to primitive gates.
*
* Revision 1.10 1999/11/27 19:07:57 steve
* Support the creation of scopes.
*
* Revision 1.9 1999/08/23 16:48:39 steve
* Parameter overrides support from Peter Monta
* AND and XOR support wide expressions.
*
* Revision 1.8 1999/08/04 02:13:02 steve
* Elaborate module ports that are concatenations of
* module signals.
*
* Revision 1.7 1999/08/03 04:14:49 steve
* Parse into pform arbitrarily complex module
* port declarations.
*
* Revision 1.6 1999/07/31 19:14:47 steve
* Add functions up to elaboration (Ed Carter)
*
* Revision 1.5 1999/07/03 02:12:51 steve
* Elaborate user defined tasks.
*
* Revision 1.4 1999/06/15 03:44:53 steve
* Get rid of the STL vector template.
*
* Revision 1.3 1999/02/21 17:01:57 steve
* Add support for module parameters.
*
* Revision 1.2 1999/01/25 05:45:56 steve
* Add the LineInfo class to carry the source file
* location of things. PGate, Statement and PProcess.
*
* elaborate handles module parameter mismatches,
* missing or incorrect lvalues for procedural
* assignment, and errors are propogated to the
* top of the elaboration call tree.
*
* Attach line numbers to processes, gates and
* assignment statements.
*
* Revision 1.1 1998/11/03 23:28:52 steve
* Introduce verilog to CVS.
* Revision 1.39 2006/03/30 01:49:07 steve
* Fix instance arrays indexed by overridden parameters.
*
* Revision 1.38 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*/
#endif
+144 -22
View File
@@ -16,24 +16,31 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PDelays.cc,v 1.2 2000/02/23 02:56:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PDelays.cc,v 1.15 2006/07/08 21:48:46 steve Exp $"
#endif
# include "config.h"
# include <iostream>
# include "PDelays.h"
# include "PExpr.h"
# include "verinum.h"
PDelays::PDelays()
{
delete_flag_ = true;
for (unsigned idx = 0 ; idx < 3 ; idx += 1)
delay_[idx] = 0;
}
PDelays::~PDelays()
{
for (unsigned idx = 0 ; idx < 3 ; idx += 1)
delete delay_[idx];
if (delete_flag_) {
for (unsigned idx = 0 ; idx < 3 ; idx += 1)
delete delay_[idx];
}
}
void PDelays::set_delay(PExpr*del)
@@ -41,41 +48,107 @@ void PDelays::set_delay(PExpr*del)
assert(del);
assert(delay_[0] == 0);
delay_[0] = del;
delete_flag_ = true;
}
void PDelays::set_delays(const svector<PExpr*>*del)
void PDelays::set_delays(const svector<PExpr*>*del, bool df)
{
assert(del);
assert(del->count() <= 3);
for (unsigned idx = 0 ; idx < del->count() ; idx += 1)
delay_[idx] = (*del)[idx];
delete_flag_ = df;
}
void PDelays::eval_delays(Design*des, const string&path,
unsigned long&rise_time,
unsigned long&fall_time,
unsigned long&decay_time) const
static NetExpr*calculate_val(Design*des, NetScope*scope, const PExpr*expr)
{
verinum*dv;
NetExpr*dex = expr->elaborate_expr(des, scope, -1, false);
if (NetExpr*tmp = dex->eval_tree()) {
delete dex;
dex = tmp;
}
/* If the delay expression is a real constant or vector
constant, then evaluate it, scale it to the local time
units, and return an adjusted value. */
if (NetECReal*tmp = dynamic_cast<NetECReal*>(dex)) {
verireal fn = tmp->value();
int shift = scope->time_unit() - des->get_precision();
long delay = fn.as_long(shift);
if (delay < 0)
delay = 0;
delete tmp;
NetEConst*tmp2 = new NetEConst(verinum(delay));
tmp2->set_line(*expr);
return tmp2;
}
if (NetEConst*tmp = dynamic_cast<NetEConst*>(dex)) {
verinum fn = tmp->value();
unsigned long delay =
des->scale_to_precision(fn.as_ulong(), scope);
delete tmp;
NetEConst*tmp2 = new NetEConst(verinum(delay));
tmp2->set_line(*expr);
return tmp2;
}
/* Oops, cannot evaluate down to a constant. */
return dex;
}
static NetExpr* make_delay_nets(Design*des, NetExpr*expr)
{
if (dynamic_cast<NetESignal*> (expr))
return expr;
if (dynamic_cast<NetEConst*> (expr))
return expr;
NetNet*sig = expr->synthesize(des);
if (sig == 0) {
cerr << expr->get_line() << ": error: Expression " << *expr
<< " is not suitable for delay expression." << endl;
return 0;
}
expr = new NetESignal(sig);
return expr;
}
void PDelays::eval_delays(Design*des, NetScope*scope,
NetExpr*&rise_time,
NetExpr*&fall_time,
NetExpr*&decay_time,
bool as_nets_flag) const
{
assert(scope);
if (delay_[0]) {
dv = delay_[0]->eval_const(des, path);
assert(dv);
rise_time = dv->as_ulong();
delete dv;
rise_time = calculate_val(des, scope, delay_[0]);
if (as_nets_flag)
rise_time = make_delay_nets(des, rise_time);
if (delay_[1]) {
dv = delay_[1]->eval_const(des, path);
assert(dv);
fall_time = dv->as_ulong();
delete dv;
fall_time = calculate_val(des, scope, delay_[1]);
if (as_nets_flag)
fall_time = make_delay_nets(des, fall_time);
if (delay_[2]) {
dv = delay_[2]->eval_const(des, path);
assert(dv);
decay_time = dv->as_ulong();
delete dv;
decay_time = calculate_val(des, scope, delay_[2]);
if (as_nets_flag)
decay_time = make_delay_nets(des, decay_time);
} else {
if (rise_time < fall_time)
decay_time = rise_time;
@@ -96,6 +169,55 @@ void PDelays::eval_delays(Design*des, const string&path,
/*
* $Log: PDelays.cc,v $
* Revision 1.15 2006/07/08 21:48:46 steve
* Handle real valued literals in net contexts.
*
* Revision 1.14 2006/06/02 04:48:49 steve
* Make elaborate_expr methods aware of the width that the context
* requires of it. In the process, fix sizing of the width of unary
* minus is context determined sizes.
*
* Revision 1.13 2006/01/03 05:22:14 steve
* Handle complex net node delays.
*
* Revision 1.12 2006/01/02 05:33:19 steve
* Node delays can be more general expressions in structural contexts.
*
* Revision 1.11 2003/06/21 01:21:42 steve
* Harmless fixup of warnings.
*
* Revision 1.10 2003/02/08 19:49:21 steve
* Calculate delay statement delays using elaborated
* expressions instead of pre-elaborated expression
* trees.
*
* Remove the eval_pexpr methods from PExpr.
*
* Revision 1.9 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.8 2001/12/29 20:19:31 steve
* Do not delete delay expressions of UDP instances.
*
* Revision 1.7 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.6 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
* Revision 1.5 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.4 2001/01/20 02:15:50 steve
* apologize for not supporting non-constant delays.
*
* Revision 1.3 2001/01/14 23:04:55 steve
* Generalize the evaluation of floating point delays, and
* get it working with delay assignment statements.
*
* Allow parameters to be referenced by hierarchical name.
*
* Revision 1.2 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
+44 -9
View File
@@ -1,7 +1,7 @@
#ifndef __PDelays_H
#define __PDelays_H
/*
* Copyright (c) 1999 Stephen Williams ([email protected])
* Copyright (c) 1999-2002 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,15 +18,24 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PDelays.h,v 1.2 2000/02/23 02:56:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PDelays.h,v 1.9 2006/01/03 05:22:14 steve Exp $"
#endif
# include "svector.h"
# include <string>
# include <iostream>
#ifdef __GNUC__
#if __GNUC__ > 2
using namespace std;
#endif
#endif
class Design;
class NetScope;
class NetExpr;
class PExpr;
class ostream;
/*
* Various PForm objects can carry delays. These delays include rise,
@@ -38,18 +47,23 @@ class PDelays {
PDelays();
~PDelays();
/* Set the delay expressions. If the delete_flag is true, then
this object takes ownership of the expressions, and will
delete it in the destructor. */
void set_delay(PExpr*);
void set_delays(const svector<PExpr*>*del);
void set_delays(const svector<PExpr*>*del, bool delete_flag=true);
void eval_delays(Design*des, const string&path,
unsigned long&rise_time,
unsigned long&fall_time,
unsigned long&decay_time) const;
void eval_delays(Design*des, NetScope*scope,
NetExpr*&rise_time,
NetExpr*&fall_time,
NetExpr*&decay_time,
bool as_nets_flag =false) const;
void dump_delays(ostream&out) const;
private:
PExpr* delay_[3];
bool delete_flag_;
private: // not implemented
PDelays(const PDelays&);
@@ -60,6 +74,27 @@ ostream& operator << (ostream&o, const PDelays&);
/*
* $Log: PDelays.h,v $
* Revision 1.9 2006/01/03 05:22:14 steve
* Handle complex net node delays.
*
* Revision 1.8 2006/01/02 05:33:19 steve
* Node delays can be more general expressions in structural contexts.
*
* Revision 1.7 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.6 2002/06/14 03:25:51 steve
* Compiler portability.
*
* Revision 1.5 2001/12/29 20:19:31 steve
* Do not delete delay expressions of UDP instances.
*
* Revision 1.4 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.3 2001/01/16 02:44:17 steve
* Use the iosfwd header if available.
*
* Revision 1.2 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
+23 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 200Stephen Williams ([email protected])
* Copyright (c) 2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,13 +16,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PEvent.cc,v 1.1 2000/04/01 19:31:57 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PEvent.cc,v 1.5 2004/02/19 06:57:10 steve Exp $"
#endif
# include "config.h"
# include "PEvent.h"
PEvent::PEvent(const string&n)
PEvent::PEvent(perm_string n)
: name_(n)
{
}
@@ -31,13 +33,29 @@ PEvent::~PEvent()
{
}
string PEvent::name() const
perm_string PEvent::name() const
{
return name_;
}
/*
* $Log: PEvent.cc,v $
* Revision 1.5 2004/02/19 06:57:10 steve
* Memory and Event names use perm_string.
*
* Revision 1.4 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
* into this table. Also, permallocate event
* names from the beginning.
*
* Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.2 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.1 2000/04/01 19:31:57 steve
* Named events as far as the pform.
*
+34 -8
View File
@@ -1,7 +1,7 @@
#ifndef __PEvent_H
#define __PEvent_H
/*
* Copyright (c) 2000 Stephen Williams ([email protected])
* Copyright (c) 2000-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,32 +18,36 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PEvent.h,v 1.3 2000/04/09 17:44:30 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PEvent.h,v 1.9 2004/02/19 06:57:10 steve Exp $"
#endif
# include "LineInfo.h"
# include "StringHeap.h"
# include <string>
class ostream;
class Design;
class NetScope;
/*
* The PEvent class represents event objects. These are things that
* are declared in Verilog as ``event foo;''
* are declared in Verilog as ``event foo;'' The name passed to the
* constructor is the "foo" part of the declaration.
*/
class PEvent : public LineInfo {
public:
explicit PEvent(const string&name);
// The name is a perm-allocated string. It is the simple name
// of the event, without any scope.
explicit PEvent(perm_string name);
~PEvent();
string name() const;
perm_string name() const;
void elaborate_scope(Design*des, NetScope*scope) const;
private:
string name_;
perm_string name_;
private: // not implemented
PEvent(const PEvent&);
@@ -52,6 +56,28 @@ class PEvent : public LineInfo {
/*
* $Log: PEvent.h,v $
* Revision 1.9 2004/02/19 06:57:10 steve
* Memory and Event names use perm_string.
*
* Revision 1.8 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
* into this table. Also, permallocate event
* names from the beginning.
*
* Revision 1.7 2003/01/30 16:23:07 steve
* Spelling fixes.
*
* Revision 1.6 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.5 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.4 2001/01/16 02:44:18 steve
* Use the iosfwd header if available.
*
* Revision 1.3 2000/04/09 17:44:30 steve
* Catch event declarations during scope elaborate.
*
+205 -31
View File
@@ -16,10 +16,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PExpr.cc,v 1.16 2000/04/12 04:23:57 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PExpr.cc,v 1.39 2007/05/24 04:07:11 steve Exp $"
#endif
# include "config.h"
# include <iostream>
# include "PExpr.h"
# include "Module.h"
# include <typeinfo>
@@ -42,30 +46,73 @@ bool PExpr::is_constant(Module*) const
return false;
}
NetNet* PExpr::elaborate_net(Design*des, const string&path, unsigned,
unsigned long,
unsigned long,
unsigned long) const
{
cerr << get_line() << ": error: Unable to elaborate `"
<< *this << "' as gates." << endl;
return 0;
}
NetNet* PExpr::elaborate_lnet(Design*des, const string&path) const
NetNet* PExpr::elaborate_lnet(Design*des, NetScope*, bool) const
{
cerr << get_line() << ": error: expression not valid in assign l-value: "
<< *this << endl;
return 0;
}
NetNet* PExpr::elaborate_bi_net(Design*des, NetScope*) const
{
cerr << get_line() << ": error: "
<< "expression not valid as argument to inout port: "
<< *this << endl;
return 0;
}
PEBinary::PEBinary(char op, PExpr*l, PExpr*r)
: op_(op), left_(l), right_(r)
{
}
PEBinary::~PEBinary()
{
}
bool PEBinary::is_constant(Module*mod) const
{
return left_->is_constant(mod) && right_->is_constant(mod);
}
PECallFunction::PECallFunction(const string &n, const svector<PExpr *> &parms)
: name_(n), parms_(parms)
PEBComp::PEBComp(char op, PExpr*l, PExpr*r)
: PEBinary(op, l, r)
{
}
PEBComp::~PEBComp()
{
}
PEBShift::PEBShift(char op, PExpr*l, PExpr*r)
: PEBinary(op, l, r)
{
}
PEBShift::~PEBShift()
{
}
PECallFunction::PECallFunction(const pform_name_t&n, const svector<PExpr *> &parms)
: path_(n), parms_(parms)
{
}
static pform_name_t pn_from_ps(perm_string n)
{
name_component_t tmp_name (n);
pform_name_t tmp;
tmp.push_back(tmp_name);
return tmp;
}
PECallFunction::PECallFunction(perm_string n, const svector<PExpr*>&parms)
: path_(pn_from_ps(n)), parms_(parms)
{
}
PECallFunction::PECallFunction(perm_string n)
: path_(pn_from_ps(n))
{
}
@@ -111,33 +158,62 @@ PExpr* PEEvent::expr() const
return expr_;
}
PEIdent::PEIdent(const string&s)
: text_(s), msb_(0), lsb_(0), idx_(0)
PEFNumber::PEFNumber(verireal*v)
: value_(v)
{
}
PEFNumber::~PEFNumber()
{
delete value_;
}
const verireal& PEFNumber::value() const
{
return *value_;
}
bool PEFNumber::is_constant(Module*) const
{
return true;
}
PEIdent::PEIdent(const pform_name_t&that)
: path_(that)
{
}
PEIdent::PEIdent(perm_string s)
{
path_.push_back(name_component_t(s));
}
PEIdent::~PEIdent()
{
}
string PEIdent::name() const
{
return text_;
}
/*
* An identifier can be in a constant expresion if (and only if) it is
* An identifier can be in a constant expression if (and only if) it is
* a parameter.
*
* NOTE: This test does not work if the name is hierarchical!
*/
bool PEIdent::is_constant(Module*mod) const
{
map<string,PExpr*>::const_iterator cur;
if (mod == 0) return false;
cur = mod->parameters.find(text_);
if (cur != mod->parameters.end()) return true;
/* */
perm_string tmp = path_.back().name;
cur = mod->localparams.find(text_);
if (cur != mod->localparams.end()) return true;
{ map<perm_string,Module::param_expr_t>::const_iterator cur;
cur = mod->parameters.find(tmp);
if (cur != mod->parameters.end()) return true;
}
{ map<perm_string,Module::param_expr_t>::const_iterator cur;
cur = mod->localparams.find(tmp);
if (cur != mod->localparams.end()) return true;
}
return false;
}
@@ -172,13 +248,14 @@ bool PENumber::is_constant(Module*) const
return true;
}
PEString::PEString(const string&s)
PEString::PEString(char*s)
: text_(s)
{
}
PEString::~PEString()
{
delete[]text_;
}
string PEString::value() const
@@ -200,13 +277,110 @@ PETernary::~PETernary()
{
}
bool PETernary::is_constant(Module*) const
bool PETernary::is_constant(Module*m) const
{
return false;
return expr_->is_constant(m)
&& tru_->is_constant(m)
&& fal_->is_constant(m);
}
PEUnary::PEUnary(char op, PExpr*ex)
: op_(op), expr_(ex)
{
}
PEUnary::~PEUnary()
{
}
bool PEUnary::is_constant(Module*m) const
{
return expr_->is_constant(m);
}
/*
* $Log: PExpr.cc,v $
* Revision 1.39 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.38 2006/10/30 05:44:49 steve
* Expression widths with unsized literals are pseudo-infinite width.
*
* Revision 1.37 2005/10/04 04:09:25 steve
* Add support for indexed select attached to parameters.
*
* Revision 1.36 2005/08/06 17:58:16 steve
* Implement bi-directional part selects.
*
* Revision 1.35 2004/10/04 01:10:51 steve
* Clean up spurious trailing white space.
*
* Revision 1.34 2004/02/20 06:22:56 steve
* parameter keys are per_strings.
*
* Revision 1.33 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.32 2002/11/09 19:20:48 steve
* Port expressions for output ports are lnets, not nets.
*
* Revision 1.31 2002/08/19 02:39:16 steve
* Support parameters with defined ranges.
*
* Revision 1.30 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.29 2001/12/30 21:32:03 steve
* Support elaborate_net for PEString objects.
*
* Revision 1.28 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.27 2001/11/08 05:15:50 steve
* Remove string paths from PExpr elaboration.
*
* Revision 1.26 2001/11/07 04:26:46 steve
* elaborate_lnet uses scope instead of string path.
*
* Revision 1.25 2001/11/06 06:11:55 steve
* Support more real arithmetic in delay constants.
*
* Revision 1.24 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.23 2001/01/14 23:04:55 steve
* Generalize the evaluation of floating point delays, and
* get it working with delay assignment statements.
*
* Allow parameters to be referenced by hierarchical name.
*
* Revision 1.22 2001/01/12 04:31:27 steve
* Handle error idents in constants not in any scope (PR#97)
*
* Revision 1.21 2000/12/16 19:03:30 steve
* Evaluate <= and ?: in parameter expressions (PR#81)
*
* Revision 1.20 2000/12/10 22:01:35 steve
* Support decimal constants in behavioral delays.
*
* Revision 1.19 2000/06/30 15:50:20 steve
* Allow unary operators in constant expressions.
*
* Revision 1.18 2000/05/07 04:37:55 steve
* Carry strength values from Verilog source to the
* pform and netlist for gates.
*
* Change vvm constants to use the driver_t to drive
* a constant value. This works better if there are
* multiple drivers on a signal.
*
* Revision 1.17 2000/05/04 03:37:58 steve
* Add infrastructure for system functions, move
* $time to that structure and add $random.
*
* Revision 1.16 2000/04/12 04:23:57 steve
* Named events really should be expressed with PEIdent
* objects in the pform,
+528 -222
View File
@@ -18,15 +18,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PExpr.h,v 1.35 2000/04/12 04:23:57 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PExpr.h,v 1.90 2007/06/04 19:14:06 steve Exp $"
#endif
# include <string>
# include <vector>
# include "netlist.h"
# include "verinum.h"
# include "verireal.h"
# include "LineInfo.h"
# include "pform_types.h"
class Design;
class Module;
@@ -51,8 +52,38 @@ class PExpr : public LineInfo {
virtual void dump(ostream&) const;
// Procedural elaboration of the expression.
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope) const;
// This method tests the width that the expression wants to
// be. It is used by elaboration of assignments to figure out
// the width of the expression.
//
// The "min" is the width of the local context, so it the
// minimum width that this function should return. Initially
// this is the same as the lval width.
//
// The "lval" is the width of the destination where this
// result is going to go. This can be used to constrain the
// amount that an expression can reasonably expand. For
// example, there is no point expanding an addition to beyond
// the lval. This extra bit of information allows the
// expression to optimize itself a bit. If the lval==0, then
// the subexpression should not make l-value related
// optimizations.
//
// The unsigned_flag is set to true if the expression is
// unsized and therefore expandable. This happens if a
// sub-expression is an unsized literal. Some expressions make
// special use of that.
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&unsized_flag) const;
// Procedural elaboration of the expression. The expr_width is
// the width of the context of the expression (i.e. the
// l-value width of an assignment) or -1 if the expression is
// self-determinted. The sys_task_arg flag is true if
// expressions are allowed to be incomplete.
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
int expr_width, bool sys_task_arg) const;
// Elaborate expressions that are the r-value of parameter
// assignments. This elaboration follows the restrictions of
@@ -62,20 +93,39 @@ class PExpr : public LineInfo {
// This method elaborate the expression as gates, for use in a
// continuous assign or other wholly structural context.
virtual NetNet* elaborate_net(Design*des, const string&path,
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0 =Link::STRONG,
Link::strength_t drive1 =Link::STRONG)
const;
// This method elaborates the expression as gates, but
// restricted for use as l-values of continuous assignments.
virtual NetNet* elaborate_lnet(Design*des, const string&path) const;
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope,
bool implicit_net_ok =false) const;
// This is similar to elaborate_lnet, except that the
// expression is evaluated to be bi-directional. This is
// useful for arguments to inout ports of module instances and
// ports of tran primitives.
virtual NetNet* elaborate_bi_net(Design*des, NetScope*scope) const;
// Expressions that can be in the l-value of procedural
// assignments can be elaborated with this method. If the
// is_force flag is true, then the set of valid l-value types
// is slightly modified to accomodate the Verilog force
// statement
virtual NetAssign_* elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const;
// This attempts to evaluate a constant expression, and return
// a verinum as a result. If the expression cannot be
// evaluated, return 0.
virtual verinum* eval_const(const Design*des, const string&path) const;
virtual verinum* eval_const(Design*des, NetScope*sc) const;
// This method returns true if that expression is the same as
// this expression. This method is used for comparing
@@ -85,7 +135,7 @@ class PExpr : public LineInfo {
// Return true if this expression is a valid constant
// expression. the Module pointer is needed to find parameter
// identifiers and any other module specific interpretations
// of expresions.
// of expressions.
virtual bool is_constant(Module*) const;
private: // not implemented
@@ -101,16 +151,31 @@ class PEConcat : public PExpr {
PEConcat(const svector<PExpr*>&p, PExpr*r =0);
~PEConcat();
virtual verinum* eval_const(Design*des, NetScope*sc) const;
virtual void dump(ostream&) const;
virtual NetNet* elaborate_lnet(Design*des, const string&path) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope,
bool implicit_net_ok =false) const;
virtual NetNet* elaborate_bi_net(Design*des, NetScope*scope) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned width,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*) const;
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const;
virtual NetEConcat*elaborate_pexpr(Design*des, NetScope*) const;
virtual NetAssign_* elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const;
virtual bool is_constant(Module*) const;
private:
NetNet* elaborate_lnet_common_(Design*des, NetScope*scope,
bool implicit_net_ok,
bool bidirectional_flag) const;
private:
svector<PExpr*>parms_;
PExpr*repeat_;
@@ -143,49 +208,169 @@ class PEEvent : public PExpr {
PExpr *expr_;
};
class PEIdent : public PExpr {
/*
* This holds a floating point constant in the source.
*/
class PEFNumber : public PExpr {
public:
explicit PEIdent(const string&s);
~PEIdent();
explicit PEFNumber(verireal*vp);
~PEFNumber();
const verireal& value() const;
/* The eval_const method as applied to a floating point number
gets the *integer* value of the number. This accounts for
any rounding that is needed to get the value. */
virtual verinum* eval_const(Design*des, NetScope*sc) const;
/* A PEFNumber is a constant, so this returns true. */
virtual bool is_constant(Module*) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned lwidth,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual void dump(ostream&) const;
// Identifiers are allowed (with restrictions) is assign l-values.
virtual NetNet* elaborate_lnet(Design*des, const string&path) const;
// Structural r-values are OK.
virtual NetNet* elaborate_net(Design*des, const string&path,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual bool is_constant(Module*) const;
verinum* eval_const(const Design*des, const string&path) const;
string name() const;
private:
string text_;
verireal*value_;
};
class PEIdent : public PExpr {
public:
// Use these to support bit- and part-select operators.
PExpr*msb_;
PExpr*lsb_;
explicit PEIdent(perm_string);
explicit PEIdent(const pform_name_t&);
~PEIdent();
// If this is a reference to a memory, this is the index
// expression.
PExpr*idx_;
// Add another name to the string of heirarchy that is the
// current identifier.
void append_name(perm_string);
virtual void dump(ostream&) const;
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&unsized_flag) const;
// Identifiers are allowed (with restrictions) is assign l-values.
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope,
bool implicit_net_ok =false) const;
virtual NetNet* elaborate_bi_net(Design*des, NetScope*scope) const;
// Identifiers are also allowed as procedural assignment l-values.
virtual NetAssign_* elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const;
// Structural r-values are OK.
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned lwidth,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
// Elaborate the PEIdent as a port to a module. This method
// only applies to Ident expressions.
NetNet* elaborate_port(Design*des, NetScope*sc) const;
virtual bool is_constant(Module*) const;
verinum* eval_const(Design*des, NetScope*sc) const;
const pform_name_t& path() const { return path_; }
private:
pform_name_t path_;
private:
// Common functions to calculate parts of part/bit selects.
bool calculate_parts_(Design*, NetScope*, long&msb, long&lsb) const;
bool calculate_up_do_width_(Design*, NetScope*, unsigned long&wid) const;
private:
NetAssign_*elaborate_lval_net_word_(Design*, NetScope*, NetNet*) const;
bool elaborate_lval_net_part_(Design*, NetScope*, NetAssign_*) const;
bool elaborate_lval_net_idx_up_(Design*, NetScope*, NetAssign_*) const;
bool elaborate_lval_net_idx_do_(Design*, NetScope*, NetAssign_*) const;
private:
NetExpr*elaborate_expr_param(Design*des,
NetScope*scope,
const NetExpr*par,
NetScope*found,
const NetExpr*par_msb,
const NetExpr*par_lsb) const;
NetExpr*elaborate_expr_net(Design*des,
NetScope*scope,
NetNet*net,
NetScope*found,
bool sys_task_arg) const;
NetExpr*elaborate_expr_net_word_(Design*des,
NetScope*scope,
NetNet*net,
NetScope*found,
bool sys_task_arg) const;
NetExpr*elaborate_expr_net_part_(Design*des,
NetScope*scope,
NetESignal*net,
NetScope*found) const;
NetExpr*elaborate_expr_net_idx_up_(Design*des,
NetScope*scope,
NetESignal*net,
NetScope*found) const;
NetExpr*elaborate_expr_net_idx_do_(Design*des,
NetScope*scope,
NetESignal*net,
NetScope*found) const;
NetExpr*elaborate_expr_net_bit_(Design*des,
NetScope*scope,
NetESignal*net,
NetScope*found) const;
public:
NetNet* elaborate_net_array_(Design*des, NetScope*scope,
NetNet*sig, unsigned lwidth,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
NetNet* elaborate_net_bitmux_(Design*des, NetScope*scope,
NetNet*sig,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
private:
NetNet* elaborate_lnet_common_(Design*des, NetScope*scope,
bool implicit_net_ok,
bool bidirectional_flag) const;
NetNet*make_implicit_net_(Design*des, NetScope*scope) const;
bool eval_part_select_(Design*des, NetScope*scope, NetNet*sig,
unsigned&midx, unsigned&lidx) const;
NetNet*process_select_(Design*des, NetScope*scope, NetNet*sig) const;
NetNet* elaborate_net_ram_(Design*des, const string&path,
NetMemory*mem, unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
};
class PENumber : public PExpr {
@@ -197,14 +382,25 @@ class PENumber : public PExpr {
const verinum& value() const;
virtual void dump(ostream&) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&unsized_flag) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
virtual NetEConst*elaborate_expr(Design*des, NetScope*) const;
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetEConst*elaborate_expr(Design*des, NetScope*,
int expr_width, bool) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(const Design*des, const string&path) const;
virtual NetAssign_* elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const;
virtual verinum* eval_const(Design*des, NetScope*sc) const;
virtual bool is_the_same(const PExpr*that) const;
virtual bool is_constant(Module*) const;
@@ -213,36 +409,65 @@ class PENumber : public PExpr {
verinum*const value_;
};
/*
* This represents a string constant in an expression.
*
* The s parameter to the PEString constructor is a C string that this
* class instance will take for its own. The caller should not delete
* the string, the destructor will do it.
*/
class PEString : public PExpr {
public:
explicit PEString(const string&s);
explicit PEString(char*s);
~PEString();
string value() const;
virtual void dump(ostream&) const;
virtual NetEConst*elaborate_expr(Design*des, NetScope*) const;
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&unsized_flag) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned width,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetEConst*elaborate_expr(Design*des, NetScope*,
int expr_width, bool) const;
virtual NetEConst*elaborate_pexpr(Design*des, NetScope*sc) const;
verinum* eval_const(Design*, NetScope*) const;
virtual bool is_constant(Module*) const;
private:
const string text_;
char*text_;
};
class PEUnary : public PExpr {
public:
explicit PEUnary(char op, PExpr*ex)
: op_(op), expr_(ex) { }
explicit PEUnary(char op, PExpr*ex);
~PEUnary();
virtual void dump(ostream&out) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned width,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
virtual NetEUnary*elaborate_expr(Design*des, NetScope*) const;
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(Design*des, NetScope*sc) const;
virtual bool is_constant(Module*) const;
private:
char op_;
@@ -252,63 +477,106 @@ class PEUnary : public PExpr {
class PEBinary : public PExpr {
public:
explicit PEBinary(char op, PExpr*l, PExpr*r)
: op_(op), left_(l), right_(r) { }
explicit PEBinary(char op, PExpr*l, PExpr*r);
~PEBinary();
virtual bool is_constant(Module*) const;
virtual void dump(ostream&out) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
unsigned width,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
virtual NetEBinary*elaborate_expr(Design*des, NetScope*) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(const Design*des, const string&path) const;
private:
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&unsized_flag) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned width,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetEBinary*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const;
virtual NetExpr*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(Design*des, NetScope*sc) const;
protected:
char op_;
PExpr*left_;
PExpr*right_;
NetEBinary*elaborate_expr_base_(Design*, NetExpr*lp, NetExpr*rp) const;
NetEBinary*elaborate_expr_base_(Design*, NetExpr*lp, NetExpr*rp, int use_wid) const;
NetEBinary*elaborate_eval_expr_base_(Design*, NetExpr*lp, NetExpr*rp, int use_wid) const;
NetNet* elaborate_net_add_(Design*des, const string&path,
private:
NetNet* elaborate_net_add_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
NetNet* elaborate_net_bit_(Design*des, const string&path,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_bit_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
NetNet* elaborate_net_cmp_(Design*des, const string&path,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_cmp_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
NetNet* elaborate_net_div_(Design*des, const string&path,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_div_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
NetNet* elaborate_net_log_(Design*des, const string&path,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_mod_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
NetNet* elaborate_net_mul_(Design*des, const string&path,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_log_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
NetNet* elaborate_net_shift_(Design*des, const string&path,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_mul_(Design*des, NetScope*scope,
unsigned lwidth,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
NetNet* elaborate_net_shift_(Design*des, NetScope*scope,
unsigned lwidth,
unsigned long rise,
unsigned long fall,
unsigned long decay) const;
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay) const;
};
/*
* Here are a few specilized classes for handling specific binary
* operators.
*/
class PEBComp : public PEBinary {
public:
explicit PEBComp(char op, PExpr*l, PExpr*r);
~PEBComp();
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&flag) const;
NetEBinary* elaborate_expr(Design*des, NetScope*scope,
int expr_width, bool sys_task_arg) const;
};
class PEBShift : public PEBinary {
public:
explicit PEBShift(char op, PExpr*l, PExpr*r);
~PEBShift();
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval, bool&flag) const;
};
/*
@@ -324,13 +592,21 @@ class PETernary : public PExpr {
virtual bool is_constant(Module*) const;
virtual void dump(ostream&out) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
virtual unsigned test_width(Design*des, NetScope*scope,
unsigned min, unsigned lval,
bool&unsized_flag) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned width,
unsigned long rise =0,
unsigned long fall =0,
unsigned long decay =0) const;
virtual NetETernary*elaborate_expr(Design*des, NetScope*) const;
virtual verinum* eval_const(const Design*des, const string&path) const;
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetETernary*elaborate_expr(Design*des, NetScope*,
int expr_width, bool sys_task_arg) const;
virtual NetETernary*elaborate_pexpr(Design*des, NetScope*sc) const;
virtual verinum* eval_const(Design*des, NetScope*sc) const;
private:
PExpr*expr_;
@@ -339,168 +615,198 @@ class PETernary : public PExpr {
};
/*
* This class represents a parsed call to a function.
* This class represents a parsed call to a function, including calls
* to system functions. The parameters in the parms list are the
* expressions that are passed as input to the ports of the function.
*/
class PECallFunction : public PExpr {
public:
explicit PECallFunction(const string &n, const svector<PExpr *> &parms);
explicit PECallFunction(const pform_name_t&n, const svector<PExpr *> &parms);
// Call of system function (name is not heirarchical)
explicit PECallFunction(perm_string n, const svector<PExpr *> &parms);
explicit PECallFunction(perm_string n);
~PECallFunction();
virtual void dump(ostream &) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*) const;
virtual NetNet* elaborate_net(Design*des, NetScope*scope,
unsigned width,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
virtual NetExpr*elaborate_expr(Design*des, NetScope*scope,
int expr_wid, bool sys_task_arg) const;
private:
string name_;
pform_name_t path_;
svector<PExpr *> parms_;
NetESFunc* elaborate_sfunc_(Design*des, NetScope*scope) const;
bool check_call_matches_definition_(Design*des, NetScope*dscope) const;
NetExpr* elaborate_sfunc_(Design*des, NetScope*scope) const;
NetNet* elaborate_net_sfunc_(Design*des, NetScope*scope,
unsigned width,
const NetExpr* rise,
const NetExpr* fall,
const NetExpr* decay,
Link::strength_t drive0,
Link::strength_t drive1) const;
};
/*
* $Log: PExpr.h,v $
* Revision 1.35 2000/04/12 04:23:57 steve
* Named events really should be expressed with PEIdent
* objects in the pform,
* Revision 1.90 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Handle named events within the mix of net events
* and edges. As a unified lot they get caught together.
* wait statements are broken into more complex statements
* that include a conditional.
* Revision 1.89 2007/06/04 02:19:07 steve
* Handle bit/part select of array words in nets.
*
* Do not generate NetPEvent or NetNEvent objects in
* elaboration. NetEvent, NetEvWait and NetEvProbe
* take over those functions in the netlist.
* Revision 1.88 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.34 2000/04/01 21:40:22 steve
* Add support for integer division.
* Revision 1.87 2007/01/16 05:44:14 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory
* classes are removed from the ivl core program, and the IVL_LPM_RAM
* lpm type is removed from the ivl_target API.
*
* Revision 1.33 2000/04/01 19:31:57 steve
* Named events as far as the pform.
* Revision 1.86 2006/11/10 04:54:26 steve
* Add test_width methods for PETernary and PEString.
*
* Revision 1.32 2000/03/12 18:22:11 steve
* Binary and unary operators in parameter expressions.
* Revision 1.85 2006/11/04 06:19:24 steve
* Remove last bits of relax_width methods, and use test_width
* to calculate the width of an r-value expression that may
* contain unsized numbers.
*
* Revision 1.31 2000/03/12 04:35:22 steve
* Allow parameter identifiers in parameter expressions.
* Revision 1.84 2006/10/30 05:44:49 steve
* Expression widths with unsized literals are pseudo-infinite width.
*
* Revision 1.30 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
* in a separate pass over the pform. Once the scopes
* are generated, I can process overrides and evalutate
* paremeters before elaboration begins.
* Revision 1.83 2006/06/18 04:15:50 steve
* Add support for system functions in continuous assignments.
*
* Revision 1.29 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
* Revision 1.82 2006/06/02 04:48:49 steve
* Make elaborate_expr methods aware of the width that the context
* requires of it. In the process, fix sizing of the width of unary
* minus is context determined sizes.
*
* Revision 1.28 2000/02/16 03:58:27 steve
* Fix up width matching in structural bitwise operators.
* Revision 1.81 2006/04/28 04:28:35 steve
* Allow concatenations as arguments to inout ports.
*
* Revision 1.27 2000/01/13 03:35:35 steve
* Multiplication all the way to simulation.
* Revision 1.80 2006/04/16 00:54:04 steve
* Cleanup lval part select handling.
*
* Revision 1.26 1999/12/16 03:46:39 steve
* Structural logical or.
* Revision 1.79 2006/04/16 00:15:43 steve
* Fix part selects in l-values.
*
* Revision 1.25 1999/11/21 00:13:08 steve
* Support memories in continuous assignments.
* Revision 1.78 2006/03/25 02:36:26 steve
* Get rid of excess PESTring:: prefix within class declaration.
*
* Revision 1.24 1999/11/14 20:24:28 steve
* Add support for the LPM_CLSHIFT device.
* Revision 1.77 2006/02/02 02:43:57 steve
* Allow part selects of memory words in l-values.
*
* Revision 1.23 1999/11/05 21:45:19 steve
* Fix NetConst being set to zero width, and clean
* up elaborate_set_cmp_ for NetEBinary.
* Revision 1.76 2006/01/02 05:33:19 steve
* Node delays can be more general expressions in structural contexts.
*
* Revision 1.22 1999/10/31 20:08:24 steve
* Include subtraction in LPM_ADD_SUB device.
* Revision 1.75 2005/12/07 04:04:23 steve
* Allow constant concat expressions.
*
* Revision 1.21 1999/10/31 04:11:27 steve
* Add to netlist links pin name and instance number,
* and arrange in vvm for pin connections by name
* and instance number.
* Revision 1.74 2005/11/27 17:01:56 steve
* Fix for stubborn compiler.
*
* Revision 1.20 1999/09/25 02:57:29 steve
* Parse system function calls.
* Revision 1.73 2005/11/27 05:56:20 steve
* Handle bit select of parameter with ranges.
*
* Revision 1.19 1999/09/15 04:17:52 steve
* separate assign lval elaboration for error checking.
* Revision 1.72 2005/11/10 13:28:11 steve
* Reorganize signal part select handling, and add support for
* indexed part selects.
*
* Revision 1.18 1999/08/31 22:38:29 steve
* Elaborate and emit to vvm procedural functions.
* Expand expression constant propagation to eliminate extra
* sums in certain cases.
*
* Revision 1.17 1999/08/01 21:18:55 steve
* elaborate rise/fall/decay for continuous assign.
* Revision 1.71 2005/10/04 04:09:25 steve
* Add support for indexed select attached to parameters.
*
* Revision 1.16 1999/07/31 19:14:47 steve
* Add functions up to elaboration (Ed Carter)
* Revision 1.70 2005/08/06 17:58:16 steve
* Implement bi-directional part selects.
*
* Revision 1.15 1999/07/22 02:05:20 steve
* is_constant method for PEConcat.
* Revision 1.69 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*
* Revision 1.14 1999/07/17 19:50:59 steve
* netlist support for ternary operator.
* Revision 1.68 2005/01/09 20:16:00 steve
* Use PartSelect/PV and VP to handle part selects through ports.
*
* Revision 1.13 1999/06/16 03:13:29 steve
* More syntax parse with sorry stubs.
* Revision 1.67 2004/12/29 23:55:43 steve
* Unify elaboration of l-values for all proceedural assignments,
* including assing, cassign and force.
*
* Revision 1.12 1999/06/15 02:50:02 steve
* Add lexical support for real numbers.
* Generate NetConcat devices for gate outputs that feed into a
* vector results. Use this to hande gate arrays. Also let gate
* arrays handle vectors of gates when the outputs allow for it.
*
* Revision 1.11 1999/06/10 04:03:52 steve
* Add support for the Ternary operator,
* Add support for repeat concatenation,
* Correct some seg faults cause by elaboration
* errors,
* Parse the casex anc casez statements.
* Revision 1.66 2004/10/04 01:10:51 steve
* Clean up spurious trailing white space.
*
* Revision 1.10 1999/06/09 03:00:05 steve
* Add support for procedural concatenation expression.
* Revision 1.65 2003/02/08 19:49:21 steve
* Calculate delay statement delays using elaborated
* expressions instead of pre-elaborated expression
* trees.
*
* Revision 1.9 1999/05/16 05:08:42 steve
* Redo constant expression detection to happen
* after parsing.
* Remove the eval_pexpr methods from PExpr.
*
* Parse more operators and expressions.
* Revision 1.64 2003/01/30 16:23:07 steve
* Spelling fixes.
*
* Revision 1.8 1999/05/10 00:16:57 steve
* Parse and elaborate the concatenate operator
* in structural contexts, Replace vector<PExpr*>
* and list<PExpr*> with svector<PExpr*>, evaluate
* constant expressions with parameters, handle
* memories as lvalues.
* Revision 1.63 2002/11/09 19:20:48 steve
* Port expressions for output ports are lnets, not nets.
*
* Parse task declarations, integer types.
* Revision 1.62 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.7 1999/05/01 02:57:52 steve
* Handle much more complex event expressions.
* Revision 1.61 2002/06/04 05:38:43 steve
* Add support for memory words in l-value of
* blocking assignments, and remove the special
* NetAssignMem class.
*
* Revision 1.6 1999/04/29 02:16:26 steve
* Parse OR of event expressions.
* Revision 1.60 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Revision 1.5 1999/04/19 01:59:36 steve
* Add memories to the parse and elaboration phases.
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.4 1998/11/11 00:01:51 steve
* Check net ranges in declarations.
* Revision 1.59 2002/04/23 03:53:59 steve
* Add support for non-constant bit select.
*
* Revision 1.3 1998/11/09 18:55:33 steve
* Add procedural while loops,
* Parse procedural for loops,
* Add procedural wait statements,
* Add constant nodes,
* Add XNOR logic gate,
* Make vvm output look a bit prettier.
* Revision 1.58 2002/04/14 03:55:25 steve
* Precalculate unary - if possible.
*
* Revision 1.2 1998/11/07 17:05:05 steve
* Handle procedural conditional, and some
* of the conditional expressions.
* Revision 1.57 2002/04/13 02:33:17 steve
* Detect missing indices to memories (PR#421)
*
* Elaborate signals and identifiers differently,
* allowing the netlist to hold signal information.
* Revision 1.56 2002/03/09 04:02:26 steve
* Constant expressions are not l-values for task ports.
*
* Revision 1.1 1998/11/03 23:28:54 steve
* Introduce verilog to CVS.
* Revision 1.55 2002/03/09 02:10:22 steve
* Add the NetUserFunc netlist node.
*
* Revision 1.54 2001/12/30 21:32:03 steve
* Support elaborate_net for PEString objects.
*
* Revision 1.53 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.52 2001/11/08 05:15:50 steve
* Remove string paths from PExpr elaboration.
*
* Revision 1.51 2001/11/07 04:26:46 steve
* elaborate_lnet uses scope instead of string path.
*
* Revision 1.50 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*/
#endif
+37 -7
View File
@@ -16,29 +16,59 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PFunction.cc,v 1.3 2000/02/23 02:56:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PFunction.cc,v 1.7 2004/05/31 23:34:36 steve Exp $"
#endif
# include "config.h"
#include "PTask.h"
PFunction::PFunction(svector<PWire*>*p, Statement*s)
: out_(0), ports_(p), statement_(s)
PFunction::PFunction(perm_string name)
: name_(name), ports_(0), statement_(0)
{
return_type_.type = PTF_NONE;
}
PFunction::~PFunction()
{
}
void PFunction::set_output(PWire*o)
void PFunction::set_ports(svector<PWire *>*p)
{
assert(out_ == 0);
out_ = o;
assert(ports_ == 0);
ports_ = p;
}
void PFunction::set_statement(Statement*s)
{
assert(s != 0);
assert(statement_ == 0);
statement_ = s;
}
void PFunction::set_return(PTaskFuncArg t)
{
return_type_ = t;
}
/*
* $Log: PFunction.cc,v $
* Revision 1.7 2004/05/31 23:34:36 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better
* speed and more type support.
*
* Revision 1.6 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.5 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.4 2001/01/13 22:20:08 steve
* Parse parameters within nested scopes.
*
* Revision 1.3 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
+143 -16
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2000 Stephen Williams ([email protected])
* Copyright (c) 1999-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,40 +16,68 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PGate.cc,v 1.8 2000/03/08 04:36:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PGate.cc,v 1.18 2006/01/03 05:22:14 steve Exp $"
#endif
# include "config.h"
# include "PGate.h"
# include "PExpr.h"
# include "verinum.h"
# include <assert.h>
PGate::PGate(const string&name,
PGate::PGate(perm_string name,
svector<PExpr*>*pins,
const svector<PExpr*>*del)
: name_(name), pins_(pins)
{
if (del) delay_.set_delays(del);
str0_ = STRONG;
str1_ = STRONG;
}
PGate::PGate(const string&name,
PGate::PGate(perm_string name,
svector<PExpr*>*pins,
PExpr*del)
: name_(name), pins_(pins)
{
if (del) delay_.set_delay(del);
str0_ = STRONG;
str1_ = STRONG;
}
PGate::PGate(const string&name, svector<PExpr*>*pins)
PGate::PGate(perm_string name, svector<PExpr*>*pins)
: name_(name), pins_(pins)
{
str0_ = STRONG;
str1_ = STRONG;
}
PGate::~PGate()
{
}
PGate::strength_t PGate::strength0() const
{
return str0_;
}
void PGate::strength0(PGate::strength_t s)
{
str0_ = s;
}
PGate::strength_t PGate::strength1() const
{
return str1_;
}
void PGate::strength1(PGate::strength_t s)
{
str1_ = s;
}
void PGate::elaborate_scope(Design*, NetScope*) const
{
}
@@ -62,22 +90,79 @@ void PGate::elaborate_scope(Design*, NetScope*) const
* parameters. This method understands how to handle the different
* numbers of expressions.
*/
void PGate::eval_delays(Design*des, const string&path,
void PGate::eval_delays(Design*des, NetScope*scope,
NetExpr*&rise_expr,
NetExpr*&fall_expr,
NetExpr*&decay_expr,
bool as_net_flag) const
{
delay_.eval_delays(des, scope,
rise_expr, fall_expr, decay_expr,
as_net_flag);
}
void PGate::eval_delays(Design*des, NetScope*scope,
unsigned long&rise_time,
unsigned long&fall_time,
unsigned long&decay_time) const
{
delay_.eval_delays(des, path, rise_time, fall_time, decay_time);
NetExpr*rise_expr, *fall_expr, *decay_expr;
delay_.eval_delays(des, scope, rise_expr, fall_expr, decay_expr);
if (rise_expr == 0) {
rise_time = 0;
fall_time = 0;
decay_time = 0;
}
if (NetEConst*tmp = dynamic_cast<NetEConst*> (rise_expr)) {
rise_time = tmp->value().as_ulong();
} else {
cerr << get_line() << ": error: Delay expressions must be "
<< "constant here." << endl;
cerr << get_line() << ": : Cannot calculate "
<< *rise_expr << endl;
des->errors += 1;
rise_time = 0;
}
if (NetEConst*tmp = dynamic_cast<NetEConst*> (fall_expr)) {
fall_time = tmp->value().as_ulong();
} else {
if (fall_expr != rise_expr) {
cerr << get_line() << ": error: Delay expressions must be "
<< "constant here." << endl;
cerr << get_line() << ": : Cannot calculate "
<< *rise_expr << endl;
}
des->errors += 1;
fall_time = 0;
}
if (NetEConst*tmp = dynamic_cast<NetEConst*> (decay_expr)) {
decay_time = tmp->value().as_ulong();
} else {
cerr << get_line() << ": error: Delay expressions must be "
<< "constant here." << endl;
cerr << get_line() << ": : Cannot calculate "
<< *rise_expr << endl;
des->errors += 1;
decay_time = 0;
}
}
PGAssign::PGAssign(svector<PExpr*>*pins)
: PGate("", pins)
: PGate(perm_string(), pins)
{
assert(pins->count() == 2);
}
PGAssign::PGAssign(svector<PExpr*>*pins, svector<PExpr*>*dels)
: PGate("", pins, dels)
: PGate(perm_string(), pins, dels)
{
assert(pins->count() == 2);
}
@@ -86,14 +171,14 @@ PGAssign::~PGAssign()
{
}
PGBuiltin::PGBuiltin(Type t, const string&name,
PGBuiltin::PGBuiltin(Type t, perm_string name,
svector<PExpr*>*pins,
svector<PExpr*>*del)
: PGate(name, pins, del), type_(t), msb_(0), lsb_(0)
{
}
PGBuiltin::PGBuiltin(Type t, const string&name,
PGBuiltin::PGBuiltin(Type t, perm_string name,
svector<PExpr*>*pins,
PExpr*del)
: PGate(name, pins, del), type_(t), msb_(0), lsb_(0)
@@ -114,16 +199,22 @@ void PGBuiltin::set_range(PExpr*msb, PExpr*lsb)
lsb_ = lsb;
}
PGModule::PGModule(const string&type, const string&name, svector<PExpr*>*pins)
: PGate(name, pins), type_(type), overrides_(0), pins_(0),
PGModule::PGModule(perm_string type, perm_string name, svector<PExpr*>*pins)
: PGate(name, pins), overrides_(0), pins_(0),
npins_(0), parms_(0), nparms_(0), msb_(0), lsb_(0)
{
type_ = type;
}
PGModule::PGModule(const string&type, const string&name,
PGModule::PGModule(perm_string type, perm_string name,
named<PExpr*>*pins, unsigned npins)
: PGate(name, 0), type_(type), overrides_(0), pins_(pins),
: PGate(name, 0), overrides_(0), pins_(pins),
npins_(npins), parms_(0), nparms_(0), msb_(0), lsb_(0)
{
type_ = type;
}
PGModule::~PGModule()
{
}
@@ -150,8 +241,44 @@ void PGModule::set_range(PExpr*msb, PExpr*lsb)
lsb_ = lsb;
}
perm_string PGModule::get_type()
{
return type_;
}
/*
* $Log: PGate.cc,v $
* Revision 1.18 2006/01/03 05:22:14 steve
* Handle complex net node delays.
*
* Revision 1.17 2006/01/02 05:33:19 steve
* Node delays can be more general expressions in structural contexts.
*
* Revision 1.16 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.15 2003/03/06 04:37:12 steve
* lex_strings.add module names earlier.
*
* Revision 1.14 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.13 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.12 2001/10/21 00:42:47 steve
* Module types in pform are char* instead of string.
*
* Revision 1.11 2001/10/19 01:55:32 steve
* Method to get the type_ member
*
* Revision 1.10 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.9 2000/05/06 15:41:56 steve
* Carry assignment strength to pform.
*
* Revision 1.8 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
+119 -28
View File
@@ -1,7 +1,7 @@
#ifndef __PGate_H
#define __PGate_H
/*
* Copyright (c) 1998-2000 Stephen Williams ([email protected])
* Copyright (c) 1998-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,11 +18,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PGate.h,v 1.16 2000/03/29 04:37:10 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PGate.h,v 1.32 2006/04/10 00:37:42 steve Exp $"
#endif
# include "svector.h"
# include "StringHeap.h"
# include "named.h"
# include "LineInfo.h"
# include "PDelays.h"
@@ -42,47 +43,75 @@ class Module;
* This pins of a gate are connected to expressions. The elaboration
* step will need to convert expressions to a network of gates in
* order to elaborate expression inputs, but that can easily be done.
*
* The PGate base class also carries the strength0 and strength1
* strengths for those gates where the driver[s] can be described by a
* single strength pair. There is a strength of the 0 drive, and a
* strength of the 1 drive.
*/
class PGate : public LineInfo {
public:
explicit PGate(const string&name, svector<PExpr*>*pins,
enum strength_t { HIGHZ, WEAK, PULL, STRONG, SUPPLY };
explicit PGate(perm_string name, svector<PExpr*>*pins,
const svector<PExpr*>*del);
explicit PGate(const string&name, svector<PExpr*>*pins,
explicit PGate(perm_string name, svector<PExpr*>*pins,
PExpr*del);
explicit PGate(const string&name, svector<PExpr*>*pins);
explicit PGate(perm_string name, svector<PExpr*>*pins);
virtual ~PGate();
const string& get_name() const { return name_; }
perm_string get_name() const { return name_; }
void eval_delays(Design*des, const string&path,
// This method evaluates the delays all the way to an
// integer. If the delay is non-constant, then set the times
// to 0, print an error message and mark an error to the
// design.
void eval_delays(Design*des, NetScope*scope,
unsigned long&rise_time,
unsigned long&fall_time,
unsigned long&decay_time) const;
// This evaluates the delays as far as possible, but returns
// an expression, and do not signal errors.
void eval_delays(Design*des, NetScope*scope,
NetExpr*&rise_time,
NetExpr*&fall_time,
NetExpr*&decay_time,
bool as_net_flag =false) const;
unsigned pin_count() const { return pins_? pins_->count() : 0; }
const PExpr*pin(unsigned idx) const { return (*pins_)[idx]; }
map<string,string> attributes;
strength_t strength0() const;
strength_t strength1() const;
virtual void dump(ostream&out) const;
virtual void elaborate(Design*des, const string&path) const;
void strength0(strength_t);
void strength1(strength_t);
map<perm_string,PExpr*> attributes;
virtual void dump(ostream&out, unsigned ind =4) const;
virtual void elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*sc) const;
virtual bool elaborate_sig(Design*des, NetScope*scope) const;
protected:
const svector<PExpr*>* get_pins() const { return pins_; }
const svector<PExpr*>& get_pins() const { return *pins_; }
void dump_pins(ostream&out) const;
void dump_delays(ostream&out) const;
private:
const string name_;
perm_string name_;
PDelays delay_;
svector<PExpr*>*pins_;
strength_t str0_, str1_;
private: // not implemented
PGate(const PGate&);
PGate& operator= (const PGate&);
@@ -99,8 +128,8 @@ class PGAssign : public PGate {
explicit PGAssign(svector<PExpr*>*pins, svector<PExpr*>*dels);
~PGAssign();
void dump(ostream&out) const;
virtual void elaborate(Design*des, const string&path) const;
void dump(ostream&out, unsigned ind =4) const;
virtual void elaborate(Design*des, NetScope*scope) const;
private:
};
@@ -125,10 +154,10 @@ class PGBuiltin : public PGate {
TRANIF1, RTRANIF0, RTRANIF1 };
public:
explicit PGBuiltin(Type t, const string&name,
explicit PGBuiltin(Type t, perm_string name,
svector<PExpr*>*pins,
svector<PExpr*>*del);
explicit PGBuiltin(Type t, const string&name,
explicit PGBuiltin(Type t, perm_string name,
svector<PExpr*>*pins,
PExpr*del);
~PGBuiltin();
@@ -136,8 +165,8 @@ class PGBuiltin : public PGate {
Type type() const { return type_; }
void set_range(PExpr*msb, PExpr*lsb);
virtual void dump(ostream&out) const;
virtual void elaborate(Design*, const string&path) const;
virtual void dump(ostream&out, unsigned ind =4) const;
virtual void elaborate(Design*, NetScope*scope) const;
private:
Type type_;
@@ -155,17 +184,21 @@ class PGBuiltin : public PGate {
class PGModule : public PGate {
public:
// The name is the *instance* name of the gate.
// If the binding of ports is by position, this constructor
// builds everything all at once.
explicit PGModule(const string&type, const string&name,
explicit PGModule(perm_string type, perm_string name,
svector<PExpr*>*pins);
// If the binding of ports is by name, this constructor takes
// the bindings and stores them for later elaboration.
explicit PGModule(const string&type, const string&name,
explicit PGModule(perm_string type, perm_string name,
named<PExpr*>*pins, unsigned npins);
~PGModule();
// Parameter overrides can come as an ordered list, or a set
// of named expressions.
void set_parameters(svector<PExpr*>*o);
@@ -175,12 +208,17 @@ class PGModule : public PGate {
// method to pass the range to the pform.
void set_range(PExpr*msb, PExpr*lsb);
virtual void dump(ostream&out) const;
virtual void elaborate(Design*, const string&path) const;
virtual void dump(ostream&out, unsigned ind =4) const;
virtual void elaborate(Design*, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*sc) const;
virtual bool elaborate_sig(Design*des, NetScope*scope) const;
// This returns the module name of this module. It is a
// permallocated string.
perm_string get_type();
private:
string type_;
perm_string type_;
svector<PExpr*>*overrides_;
named<PExpr*>*pins_;
unsigned npins_;
@@ -193,14 +231,67 @@ class PGModule : public PGate {
PExpr*msb_;
PExpr*lsb_;
void elaborate_mod_(Design*, Module*mod, const string&path) const;
void elaborate_sudp_(Design*, PUdp *udp, const string&path) const;
void elaborate_cudp_(Design*, PUdp *udp, const string&path) const;
void elaborate_mod_(Design*, Module*mod, NetScope*scope) const;
void elaborate_udp_(Design*, PUdp *udp, NetScope*scope) const;
void elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const;
bool elaborate_sig_mod_(Design*des, NetScope*scope, Module*mod) const;
};
/*
* $Log: PGate.h,v $
* Revision 1.32 2006/04/10 00:37:42 steve
* Add support for generate loops w/ wires and gates.
*
* Revision 1.31 2006/01/03 05:22:14 steve
* Handle complex net node delays.
*
* Revision 1.30 2006/01/02 05:33:19 steve
* Node delays can be more general expressions in structural contexts.
*
* Revision 1.29 2004/10/04 01:10:52 steve
* Clean up spurious trailing white space.
*
* Revision 1.28 2004/03/08 00:47:44 steve
* primitive ports can bind bi name.
*
* Revision 1.27 2004/02/20 18:53:33 steve
* Addtrbute keys are perm_strings.
*
* Revision 1.26 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.25 2003/03/06 04:37:12 steve
* lex_strings.add module names earlier.
*
* Revision 1.24 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.23 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.22 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.21 2001/10/21 00:42:47 steve
* Module types in pform are char* instead of string.
*
* Revision 1.20 2001/10/19 01:55:32 steve
* Method to get the type_ member
*
* Revision 1.19 2001/04/22 23:09:45 steve
* More UDP consolidation from Stephan Boettcher.
*
* Revision 1.18 2000/05/06 15:41:56 steve
* Carry assignment strength to pform.
*
* Revision 1.17 2000/05/02 16:27:38 steve
* Move signal elaboration to a seperate pass.
*
* Revision 1.16 2000/03/29 04:37:10 steve
* New and improved combinational primitives.
*
+63
View File
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2006 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PGenerate.cc,v 1.4 2007/06/02 03:42:12 steve Exp $"
#endif
# include "PGenerate.h"
# include "PWire.h"
PGenerate::PGenerate(unsigned id)
: id_number(id)
{
parent = 0;
}
PGenerate::~PGenerate()
{
}
PWire* PGenerate::add_wire(PWire*wire)
{
PWire*&ep = wires[wire->path()];
if (ep) return ep;
assert(ep == 0);
ep = wire;
return wire;
}
PWire* PGenerate::get_wire(const pform_name_t&name) const
{
map<pform_name_t,PWire*>::const_iterator obj = wires.find(name);
if (obj == wires.end())
return 0;
else
return (*obj).second;
}
void PGenerate::add_gate(PGate*gate)
{
gates.push_back(gate);
}
void PGenerate::add_behavior(PProcess*proc)
{
behaviors.push_back(proc);
}
+100
View File
@@ -0,0 +1,100 @@
#ifndef __PGenerate_H
#define __PGenerate_H
/*
* Copyright (c) 2006 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PGenerate.h,v 1.4 2007/06/02 03:42:12 steve Exp $"
#endif
# include "LineInfo.h"
# include "StringHeap.h"
# include "HName.h"
# include <list>
# include <map>
# include "pform_types.h"
class Design;
class NetScope;
class PExpr;
class PProcess;
class PGate;
class PWire;
/*
* This represents a generate scheme.
*/
class PGenerate : public LineInfo {
public:
PGenerate(unsigned id_number);
~PGenerate();
// Generate schemes have an ID number, for when the scope is
// implicit.
const unsigned id_number;
perm_string scope_name;
enum scheme_t {GS_NONE, GS_LOOP, GS_CONDIT};
scheme_t scheme_type;
// generate loops have an index variable and three
// expressions: for (index = <init>; <test>; index=<step>)
perm_string loop_index;
PExpr*loop_init;
PExpr*loop_test;
PExpr*loop_step;
map<pform_name_t,PWire*>wires;
PWire* add_wire(PWire*);
PWire* get_wire(const pform_name_t&name) const;
list<PGate*> gates;
void add_gate(PGate*);
list<PProcess*> behaviors;
void add_behavior(PProcess*behave);
list<PGenerate*> generates;
PGenerate*parent;
// This method is called by the elaboration of a module to
// generate scopes. the container is the scope that is to
// contain the generated scope.
bool generate_scope(Design*des, NetScope*container);
bool elaborate_sig(Design*des) const;
bool elaborate(Design*des) const;
void dump(ostream&out, unsigned indent) const;
private:
bool generate_scope_loop_(Design*des, NetScope*container);
// These are the scopes created by generate_scope.
list<NetScope*>scope_list_;
// internal function called on each scope generated by this scheme.
bool elaborate_sig_(Design*des, NetScope*scope) const;
bool elaborate_(Design*des, NetScope*scope) const;
private: // not implemented
PGenerate(const PGenerate&);
PGenerate& operator= (const PGenerate&);
};
#endif
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2006 Stephen Williams <[email protected]>
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PSpec.cc,v 1.2 2007/02/12 01:52:21 steve Exp $"
#endif
# include "PSpec.h"
PSpecPath::PSpecPath(unsigned src_cnt, unsigned dst_cnt)
: conditional(false), condition(0), edge(0),
src(src_cnt), dst(dst_cnt),
data_source_expression(0)
{
}
PSpecPath::~PSpecPath()
{
}
+79
View File
@@ -0,0 +1,79 @@
#ifndef __PSpec_H
#define __PSpec_H
/*
* Copyright (c) 2006 Stephen Williams <[email protected]>
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PSpec.h,v 1.3 2007/04/13 02:34:35 steve Exp $"
#endif
# include "LineInfo.h"
# include "StringHeap.h"
# include <vector>
class PExpr;
/*
* The PSpecPath is the parse of a specify path, which is in its most
* general form <path> = <delays>. The <delays> are collected into the
* "delays" vector in all cases, and the variety is in the other
* members.
*
* All paths also have a list of source names in the src vector, and a
* list of destination names in the dst vector. These pairs are the
* actual paths.
*
* If the path is a simple path, then:
* condition == nil
* edge == 0
* data_source_expression == nil
*
* If the path is conditional, then conditional == true and condition
* is the condition expression. If the condition expression is nil,
* then this is an ifnone conditional path.
*
* If data_source_expression != nil, then the path is edge sensitive
* and the edge might not be 0.
*/
class PSpecPath : public LineInfo {
public:
PSpecPath(unsigned src_cnt, unsigned dst_cnt);
~PSpecPath();
void elaborate(class Design*des, class NetScope*scope) const;
void dump(std::ostream&out, unsigned ind) const;
public:
// Condition expression, if present.
bool conditional;
class PExpr* condition;
// Edge specification (-1==negedge, 0 = no edge, 1==posedge)
int edge;
// Ordered set of source nodes of a path
std::vector<perm_string> src;
// Ordered set of destination nodes of a path
std::vector<perm_string> dst;
// Data source expression
class PExpr* data_source_expression;
std::vector<class PExpr*>delays;
};
#endif
+32 -4
View File
@@ -16,14 +16,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PTask.cc,v 1.3 2000/02/23 02:56:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PTask.cc,v 1.7 2002/08/12 01:34:58 steve Exp $"
#endif
# include "config.h"
# include "PTask.h"
PTask::PTask(svector<PWire*>*p, Statement*s)
: ports_(p), statement_(s)
PTask::PTask()
: ports_(0), statement_(0)
{
}
@@ -31,8 +33,34 @@ PTask::~PTask()
{
}
void PTask::set_ports(svector<PWire*>*p)
{
assert(ports_ == 0);
ports_ = p;
}
void PTask::set_statement(Statement*s)
{
assert(statement_ == 0);
statement_ = s;
}
/*
* $Log: PTask.cc,v $
* Revision 1.7 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.6 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.5 2001/04/19 03:04:47 steve
* Spurious assert of empty statemnt.
*
* Revision 1.4 2001/01/13 22:20:08 steve
* Parse parameters within nested scopes.
*
* Revision 1.3 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
+65 -11
View File
@@ -18,17 +18,34 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PTask.h,v 1.8 2000/03/08 04:36:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PTask.h,v 1.14 2007/03/06 05:22:49 steve Exp $"
#endif
# include "LineInfo.h"
# include "svector.h"
# include "StringHeap.h"
# include <string>
class Design;
class NetScope;
class PWire;
class Statement;
class PExpr;
enum PTaskFuncEnum {
PTF_NONE,
PTF_REG,
PTF_REG_S,
PTF_INTEGER,
PTF_REAL,
PTF_REALTIME,
PTF_TIME
};
struct PTaskFuncArg {
PTaskFuncEnum type;
svector<PExpr*>*range;
};
/*
* The PTask holds the parsed definitions of a task.
@@ -36,17 +53,23 @@ class Statement;
class PTask : public LineInfo {
public:
explicit PTask(svector<PWire*>*p, Statement*s);
explicit PTask();
~PTask();
void set_ports(svector<PWire *>*p);
void set_statement(Statement *s);
// Tasks introduce scope, to need to be handled during the
// scope elaboration pass. The scope passed is my scope,
// created by the containing scope. I fill it in with stuff if
// I need to.
void elaborate_scope(Design*des, NetScope*scope) const;
void elaborate_1(Design*des, const string&path) const;
void elaborate_2(Design*des, const string&path) const;
// Bind the ports to the regs that are the ports.
void elaborate_sig(Design*des, NetScope*scope) const;
// Elaborate the statement to finish off the task definition.
void elaborate(Design*des, NetScope*scope) const;
void dump(ostream&, unsigned) const;
@@ -63,31 +86,62 @@ class PTask : public LineInfo {
* The function is similar to a task (in this context) but there is a
* single output port and a set of input ports. The output port is the
* function return value.
*
* The output value is not elaborated until elaborate_sig.
*/
class PFunction : public LineInfo {
public:
explicit PFunction(svector<PWire *>*p, Statement *s);
explicit PFunction(perm_string name);
~PFunction();
void set_output(PWire*);
void set_ports(svector<PWire *>*p);
void set_statement(Statement *s);
void set_return(PTaskFuncArg t);
void elaborate_scope(Design*des, NetScope*scope) const;
/* Functions are elaborated in 2 passes. */
void elaborate_1(Design *des, NetScope*) const;
void elaborate_2(Design *des, NetScope*) const;
/* elaborate the ports and return value. */
void elaborate_sig(Design *des, NetScope*) const;
/* Elaborate the behavioral statement. */
void elaborate(Design *des, NetScope*) const;
void dump(ostream&, unsigned) const;
private:
PWire*out_;
perm_string name_;
PTaskFuncArg return_type_;
svector<PWire *> *ports_;
Statement *statement_;
};
/*
* $Log: PTask.h,v $
* Revision 1.14 2007/03/06 05:22:49 steve
* Support signed function return values.
*
* Revision 1.13 2004/05/31 23:34:36 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better
* speed and more type support.
*
* Revision 1.12 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.11 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.10 2001/01/13 22:20:08 steve
* Parse parameters within nested scopes.
*
* Revision 1.9 2000/07/30 18:25:43 steve
* Rearrange task and function elaboration so that the
* NetTaskDef and NetFuncDef functions are created during
* signal enaboration, and carry these objects in the
* NetScope class instead of the extra, useless map in
* the Design class.
*
* Revision 1.8 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
+53
View File
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2003-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PUdp.cc,v 1.3 2004/03/08 00:47:44 steve Exp $"
#endif
# include "PUdp.h"
PUdp::PUdp(perm_string n, unsigned nports)
: ports(nports), sequential(false), initial(verinum::Vx), name_(n)
{
}
unsigned PUdp::find_port(const char*name)
{
for (unsigned idx = 0 ; idx < ports.count() ; idx += 1) {
if (ports[idx] == name)
return idx;
}
return ports.count();
}
/*
* $Log: PUdp.cc,v $
* Revision 1.3 2004/03/08 00:47:44 steve
* primitive ports can bind bi name.
*
* Revision 1.2 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.1 2003/07/15 05:07:13 steve
* Move PUdp constructor into compiled file.
*
*/
+41 -14
View File
@@ -1,7 +1,7 @@
#ifndef __PUdp_H
#define __PUdp_H
/*
* Copyright (c) 1998-2000 Stephen Williams ([email protected])
* Copyright (c) 1998-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,25 +18,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PUdp.h,v 1.4 2000/02/23 02:56:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PUdp.h,v 1.12 2004/03/08 00:47:44 steve Exp $"
#endif
# include <map>
# include "StringHeap.h"
# include "svector.h"
# include <string>
# include "verinum.h"
svector<string>::svector<string>(unsigned size)
: nitems_(size), items_(new string[size])
{
}
class PExpr;
/*
* This class represents a parsed UDP. This is a much simpler object
* then a module or macromodule.
*
* - all ports are scaler,
* - all ports are scalar,
* - pin 0 (the first port) is always output,
* and the remaining pins are input.
*
@@ -51,15 +48,16 @@ svector<string>::svector<string>(unsigned size)
* the current output.
*
* If the UDP is sequential, the "initial" member is taken to be the
* intial value assigned in the source, or 'x' if none is given.
* initial value assigned in the source, or 'x' if none is given.
*/
class PUdp {
public:
explicit PUdp(const string&n, unsigned nports)
: ports(nports), sequential(false), initial(verinum::Vx), name_(n) { }
explicit PUdp(perm_string n, unsigned nports);
svector<string>ports;
unsigned find_port(const char*name);
bool sequential;
svector<string>tinput;
@@ -68,12 +66,12 @@ class PUdp {
verinum::V initial;
map<string,string> attributes;
map<string,PExpr*> attributes;
void dump(ostream&out) const;
perm_string name_;
private:
const string name_;
private: // Not implemented
PUdp(const PUdp&);
@@ -82,6 +80,35 @@ class PUdp {
/*
* $Log: PUdp.h,v $
* Revision 1.12 2004/03/08 00:47:44 steve
* primitive ports can bind bi name.
*
* Revision 1.11 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.10 2003/07/15 05:07:13 steve
* Move PUdp constructor into compiled file.
*
* Revision 1.9 2003/07/15 03:49:22 steve
* Spelling fixes.
*
* Revision 1.8 2003/01/30 16:23:07 steve
* Spelling fixes.
*
* Revision 1.7 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.6 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.5 2001/04/22 23:09:45 steve
* More UDP consolidation from Stephan Boettcher.
*
* Revision 1.4 2000/02/23 02:56:53 steve
* Macintosh compilers do not support ident.
*
+93 -8
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Stephen Williams ([email protected])
* Copyright (c) 1999-2007 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,16 +16,27 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PWire.cc,v 1.3 2000/02/23 02:56:54 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PWire.cc,v 1.14 2007/05/24 04:07:11 steve Exp $"
#endif
# include "config.h"
# include "PWire.h"
# include <assert.h>
PWire::PWire(const string&n, NetNet::Type t, NetNet::PortType pt)
: name_(n), type_(t), port_type_(pt), lidx_(0), ridx_(0)
PWire::PWire(const pform_name_t&n,
NetNet::Type t,
NetNet::PortType pt,
ivl_variable_type_t dt)
: hname_(n), type_(t), port_type_(pt), data_type_(dt),
signed_(false), isint_(false),
lidx_(0), ridx_(0)
{
if (t == NetNet::INTEGER) {
type_ = NetNet::REG;
signed_ = true;
isint_ = true;
}
}
NetNet::Type PWire::get_wire_type() const
@@ -33,6 +44,11 @@ NetNet::Type PWire::get_wire_type() const
return type_;
}
const pform_name_t& PWire::path() const
{
return hname_;
}
bool PWire::set_wire_type(NetNet::Type t)
{
assert(t != NetNet::IMPLICIT);
@@ -43,11 +59,13 @@ bool PWire::set_wire_type(NetNet::Type t)
return true;
case NetNet::IMPLICIT_REG:
if (t == NetNet::REG) { type_ = t; return true; }
if (t == NetNet::INTEGER) {type_ = t; return true; }
return false;
case NetNet::REG:
if (t == NetNet::INTEGER) {
isint_ = true;
return true;
}
if (t == NetNet::REG) return true;
if (t == NetNet::INTEGER) {type_ = t; return true; }
return false;
default:
if (type_ != t)
@@ -83,6 +101,34 @@ bool PWire::set_port_type(NetNet::PortType pt)
}
}
bool PWire::set_data_type(ivl_variable_type_t dt)
{
if (data_type_ != IVL_VT_NO_TYPE)
if (data_type_ != dt)
return false;
else
return true;
assert(data_type_ == IVL_VT_NO_TYPE);
data_type_ = dt;
return true;
}
void PWire::set_signed(bool flag)
{
signed_ = flag;
}
bool PWire::get_signed() const
{
return signed_;
}
bool PWire::get_isint() const
{
return isint_;
}
void PWire::set_range(PExpr*m, PExpr*l)
{
msb_ = svector<PExpr*>(msb_,m);
@@ -93,13 +139,52 @@ void PWire::set_memory_idx(PExpr*ldx, PExpr*rdx)
{
assert(lidx_ == 0);
assert(ridx_ == 0);
assert((type_ == NetNet::REG) || (type_ == NetNet::INTEGER));
lidx_ = ldx;
ridx_ = rdx;
}
/*
* $Log: PWire.cc,v $
* Revision 1.14 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.13 2007/04/26 03:06:21 steve
* Rework hname_t to use perm_strings.
*
* Revision 1.12 2007/01/16 05:44:14 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory
* classes are removed from the ivl core program, and the IVL_LPM_RAM
* lpm type is removed from the ivl_target API.
*
* Revision 1.11 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*
* Revision 1.10 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.9 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.8 2002/01/26 05:28:28 steve
* Detect scalar/vector declarion mismatch.
*
* Revision 1.7 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.6 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.5 2001/01/06 02:29:35 steve
* Support arrays of integers.
*
* Revision 1.4 2000/12/11 00:31:43 steve
* Add support for signed reg variables,
* simulate in t-vvm signed comparisons.
*
* Revision 1.3 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
*
+74 -32
View File
@@ -1,7 +1,7 @@
#ifndef __PWire_H
#define __PWire_H
/*
* Copyright (c) 1998-2000 Stephen Williams ([email protected])
* Copyright (c) 1998-2007 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,30 +18,46 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PWire.h,v 1.7 2000/02/23 02:56:54 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: PWire.h,v 1.21 2007/05/24 04:07:11 steve Exp $"
#endif
# include "netlist.h"
# include "LineInfo.h"
# include <map>
# include <map>
# include "svector.h"
# include "StringHeap.h"
#ifdef HAVE_IOSFWD
# include <iosfwd>
#else
class ostream;
#endif
class PExpr;
class Design;
/*
* Wires include nets, registers and ports. A net or register becomes
* a port by declaration, so ports are not seperate. The module
* a port by declaration, so ports are not separate. The module
* identifies a port by keeping it in its port list.
*
* The hname parameter to the constructor is a hierarchical name. It
* is the name of the wire within a module, so does not include the
* current scope or any instances. Modules contain all the wires, so
* from that perspective, sub-scopes within the module are a part of
* the wire name.
*/
class PWire : public LineInfo {
public:
PWire(const string&n, NetNet::Type t, NetNet::PortType pt);
PWire(const pform_name_t&hname,
NetNet::Type t,
NetNet::PortType pt,
ivl_variable_type_t dt);
const string&name() const { return name_; }
// Return a hierarchical name.
const pform_name_t&path() const;
NetNet::Type get_wire_type() const;
bool set_wire_type(NetNet::Type);
@@ -49,21 +65,31 @@ class PWire : public LineInfo {
NetNet::PortType get_port_type() const;
bool set_port_type(NetNet::PortType);
void set_signed(bool flag);
bool get_signed() const;
bool get_isint() const;
bool set_data_type(ivl_variable_type_t dt);
ivl_variable_type_t get_data_type() const;
void set_range(PExpr*msb, PExpr*lsb);
void set_memory_idx(PExpr*ldx, PExpr*rdx);
map<string,string> attributes;
map<perm_string,PExpr*> attributes;
// Write myself to the specified stream.
void dump(ostream&out) const;
void dump(ostream&out, unsigned ind=4) const;
void elaborate(Design*, NetScope*scope) const;
NetNet* elaborate_sig(Design*, NetScope*scope) const;
private:
string name_;
pform_name_t hname_;
NetNet::Type type_;
NetNet::PortType port_type_;
ivl_variable_type_t data_type_;
bool signed_;
bool isint_; // original type of integer
// These members hold expressions for the bit width of the
// wire. If they do not exist, the wire is 1 bit wide.
@@ -82,32 +108,48 @@ class PWire : public LineInfo {
/*
* $Log: PWire.h,v $
* Revision 1.7 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
* Revision 1.21 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.6 1999/11/27 19:07:57 steve
* Support the creation of scopes.
* Revision 1.20 2007/04/26 03:06:22 steve
* Rework hname_t to use perm_strings.
*
* Revision 1.5 1999/06/17 05:34:42 steve
* Clean up interface of the PWire class,
* Properly match wire ranges.
* Revision 1.19 2006/04/10 00:37:42 steve
* Add support for generate loops w/ wires and gates.
*
* Revision 1.4 1999/06/02 15:38:46 steve
* Line information with nets.
* Revision 1.18 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*
* Revision 1.3 1999/04/19 01:59:36 steve
* Add memories to the parse and elaboration phases.
* Revision 1.17 2004/02/20 18:53:33 steve
* Addtrbute keys are perm_strings.
*
* Revision 1.2 1998/11/23 00:20:22 steve
* NetAssign handles lvalues as pin links
* instead of a signal pointer,
* Wire attributes added,
* Ability to parse UDP descriptions added,
* XNF generates EXT records for signals with
* the PAD attribute.
* Revision 1.16 2003/01/30 16:23:07 steve
* Spelling fixes.
*
* Revision 1.1 1998/11/03 23:28:55 steve
* Introduce verilog to CVS.
* Revision 1.15 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
*
* Revision 1.14 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.13 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.12 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.11 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.10 2001/01/16 02:44:18 steve
* Use the iosfwd header if available.
*/
#endif
+83
View File
@@ -0,0 +1,83 @@
* Getting Started with Icarus Verilog
Icarus Verilog is a Verilog compiler. It is suitable for use as a
simulator, and, to some degree, synthesizer. Icarus Verilog runs under
Linux and a variety of UNIX systems, as well as Windows as a command
line tool, so the instructions are generally applicable to all
environments. Note that this is only a quick start. For more detailed
documentation, see the manual page for the iverilog command.
* Hello, World!
The first thing you want to do as a user is learn how to compile and
execute even the most trivial design. For the purposes of simulation,
we use as our example *the* most trivial simulation:
module main;
initial
begin
$display("Hello, World");
$finish ;
end
endmodule
By a text editor (or copy hello.vl from the Icarus Verilog examples
directory) arrange for this program to be in a text file, "hello.vl".
Next, compile this program with a command like this:
% iverilog -o hello hello.vl
The results of this compile are placed into the file "hello", as the
"-o" flag tells the compiler where to place the compiled result. Next,
execute the compiled program like so:
% vvp hello
Hello, World
And there it is, the program has been executed. So what happened? The
first step, the "iverilog" command, read and interpreted the source
file, then generated a compiled result. The compiled form may be
selected by command line switches, but the default form is the VVP
format, which is actually run by the "vvp" command.
The "iverilog" and "vvp" commands are the only commands that users
use to invoke Icarus Verilog. What the compiler actually does is
controlled by command line switches. In our little example, we asked
the compiler to compile the source program to the default vvp form,
which is in turn executed by the vvp program.
* Windows Install
The easiest way to install under Windows is to get a precompiled
installer for the version you wish to install. Icarus Verilog is
distributed for Windows users as a self-installing .exe. Just execute
the installer and follow the instructions. During the install, take
note of the directory where the program is installed: for example,
C:\iverilog is a good place to install.
Once the binary is installed, you need to add the bin directory to
your execution path. The executables you need are in C:\iverilog\bin,
where the "C:\iverilog" part is actually the root of where you
installed the package. The programs are in the bin subdirectory. Put
this directory in your PATH environment variable, and the above
commands become accessible to you at the command line prompt, or even
in batch files.
* Linux Install
Under Linux, the install is even easier. For RedHat and Mandrake based
systems, there is the appropriate RPM file. Just install the package
with the "rpm -U <file>" command. Debian users should get Icarus
Verilog packages from the main Debian software site.
* Install From Source
In this case, see README.txt and other documentation that comes with
the source.
+299 -196
View File
@@ -1,23 +1,27 @@
THE ICARUS VERILOG COMPILATION SYSTEM
September 18, 1999
THE ICARUS VERILOG COMPILATION SYSTEM
Copyright 2000-2004 Stephen Williams
1.0 What is ICARUS Verilog?
Icarus Verilog is intended to compile ALL of the Verilog HDL as described
in the IEEE-1364 standard. Of course, it's not quite there yet. It does
currently handle a mix of structural and behavioral constructs. For a
view of the current state of Icarus Verilog, see its home page at
<http://www.icarus.com/eda/verilog>.
IVL is not aimed at being a simulator in the traditional sense, but a
compiler that generates code employed by back-end tools. These back-
end tools currently include a simulator written in C++ called VVM
and an XNF (Xilinx Netlist Format) generator. See "vvm.txt" and
"xnf.txt" for further details on these back-end processors. In the
future, backends are expected for EDIF/LPM, structural Verilog, etc.
Icarus Verilog is intended to compile ALL of the Verilog HDL as
described in the IEEE-1364 standard. Of course, it's not quite there
yet. It does currently handle a mix of structural and behavioral
constructs. For a view of the current state of Icarus Verilog, see its
home page at <http://www.icarus.com/eda/verilog>.
2.0 Building/Installing IVL From Source
Icarus Verilog is not aimed at being a simulator in the traditional
sense, but a compiler that generates code employed by back-end
tools. These back-end tools currently include a simulator engine
called VVP, an XNF (Xilinx Netlist Format) generator and an EDIF FPGA
netlist generator. In the future, backends are expected for EDIF/LPM,
structural Verilog, VHDL, etc.
For instructions on how to run Icarus Verilog,
see the ``iverilog'' man page.
2.0 Building/Installing Icarus Verilog From Source
If you are starting from source, the build process is designed to be
as simple as practical. Someone basically familiar with the target
@@ -25,22 +29,26 @@ system and C/C++ compilation should be able to build the source
distribution with little effort. Some actual programming skills are
not required, but helpful in case of problems.
If you are building for Windows, see the mingw.txt file.
2.1 Compile Time Prerequisites
You need the following software to compile Icarus Verilog from source
on a UNIX-like system:
- GNU Make
The Makefiles use some GNU extensions to, so a basic POSIX
The Makefiles use some GNU extensions, so a basic POSIX
make will not work. Linux systems typically come with a
satisfactory make.
satisfactory make. BSD based systems (i.e., NetBSD, FreeBSD)
typically have GNU make as the gmake program.
- ISO C++ Compiler
The ivl program is written in C++ and makes use of templates
and some of the standard C++ library. egcs compilers with
the associated libstdc++ are known to work.
The ivl and ivlpp programs are written in C++ and make use
of templates and some of the standard C++ library. egcs and
recent gcc compilers with the associated libstdc++ are known
to work. MSVC++ 5 and 6 are known to definitely *not* work.
- bison
- bison and flex
- gperf 2.7
The lexical analyzer doesn't recognize keywords directly,
@@ -48,6 +56,25 @@ on a UNIX-like system:
table in order to get the proper lexical code. The gperf
program generates the lookup table.
A version problem with this program is the most common cause
of difficulty. See the Icarus Verilog FAQ.
- readline 4.2
On Linux systems, this usually means the readline-devel
rpm. In any case, it is the development headers of readline
that are needed.
- termcap
The readline library in turn uses termcap.
If you are building from CVS, you will also need software to generate
the configure scripts.
- autoconf 2.53
This generates configure scripts from configure.in. The 2.53
or later versions are known to work, autoconf 2.13 is
reported to *not* work.
2.2 Compilation
Unpack the tar-ball and cd into the verilog-######### directory
@@ -57,16 +84,71 @@ with the commands:
./configure
make
2.3 Installation
Normally, this command automatically figures out everything it needs
to know. It generally works pretty well. There are a few flags to the
configure script that modify its behavior:
--without-ipal
This turns off support for Icarus PAL, whether ipal
libraries are installed or not.
--prefix=<root>
The default is /usr/local, which causes the tool suite to
be compiled for install in /usr/local/bin,
/usr/local/share/ivl, etc.
I recommend that if you are configuring for precompiled
binaries, use --prefix=/usr. On Solaris systems, it is
common to use --prefix=/opt. You can configure for a non-root
install with --prefix=$HOME.
--enable-vvp32 (experimental)
If compiling on AMD64 systems, this enables the
compilation of 32bit compatible vvp (vvp32) and the vpi
modules that match.
2.2.1 Special AMD64 Instructions
(The Icarus Verilog RPM for x86_64 is build using these instructions.)
If you are building for Linux/AMD64 (a.k.a x86_64) then to get the
most out of your install, first make sure you have both 64bit and
32bit development libraries installed. Then configure with this
somewhat more complicated command:
./configure libdir64='$(prefix)/lib64' vpidir1=vpi64 vpidir2=. --enable-vvp32
This reflects the convention on AMD64 systems that 64bit libraries go
into lib64 directories. The "--enable-vvp32" also turns on 32bit
compatibility files. A 32bit version of vvp (vvp32) will be created,
as well as 32bit versions of the development libraries and bundled VPI
libraries.
2.3 (Optional) Testing
To run a simple test before installation, execute
make check
The commands printed by this run might help you in running Icarus
Verilog on your own Verilog sources before the package is installed
by root.
2.4 Installation
Now install the files in an appropriate place. (The makefiles by
default install in /usr/local unless you specify a different prefix
with the --prefix=<path> flag to the configure command.) Do this as
root.
with the --prefix=<path> flag to the configure command.) You may need
to do this as root to gain access to installation directories.
make install
3.0 How IVL Works
2.5 Uninstallation
The generated Makefiles also include the uninstall target. This should
remove all the files that ``make install'' creates.
3.0 How Icarus Verilog Works
This tool includes a parser which reads in Verilog (plus extensions)
and generates an internal netlist. The netlist is passed to various
@@ -85,15 +167,15 @@ only sees a single input file. See ivlpp/ivlpp.txt for details.
3.2 Parse
The verilog compiler starts by parsing the verilog source file. The
output of the parse in a list of Module objects in PFORM. The pform
The Verilog compiler starts by parsing the Verilog source file. The
output of the parse is a list of Module objects in "pform". The pform
(see pform.h) is mostly a direct reflection of the compilation
step. There may be dangling references, and it is not yet clear which
module is the root.
One can see a human readable version of the final PFORM by using the
``-P <path>'' flag to the compiler. This will cause ivl to dump the
PFORM into the file named <path>.
One can see a human readable version of the final pform by using the
``-P <path>'' flag to the compiler. This will cause iverilog to dump
the pform into the file named <path>.
3.3 Elaboration
@@ -101,26 +183,25 @@ This phase takes the pform and generates a netlist. The driver selects
(by user request or lucky guess) the root module to elaborate,
resolves references and expands the instantiations to form the design
netlist. (See netlist.txt.) Final semantic checks are performed during
elaboration, and some simple optimizations are performed.
elaboration, and some simple optimizations are performed. The netlist
includes all the behavioral descriptions, as well as gates and wires.
The elaborate() function performs the elaboration.
One can see a human readable version of the final, elaborated and
optimized netlist by using the ``-N <path>'' flag to the compiler. If
elaboration succeeds, the final netlist (i.e. after optimizations but
elaboration succeeds, the final netlist (i.e., after optimizations but
before code generation) will be dumped into the file named <path>.
Elaboration is actually performed it two steps: scopes and parameters
Elaboration is actually performed in two steps: scopes and parameters
first, followed by the structural and behavioral elaboration.
3.3.1 Scope Elaboration
This pass scans through the pform looking for scopes and
parameters. A tree of NetScope objects is built up and placed in the
Design object, with the root module represented by the root NetScope
object.
The elab_scope.cc and elab_pexpr.cc files contain most of the code for
This pass scans through the pform looking for scopes and parameters. A
tree of NetScope objects is built up and placed in the Design object,
with the root module represented by the root NetScope object. The
elab_scope.cc and elab_pexpr.cc files contain most of the code for
handling this phase.
The tail of the elaborate_scope behavior (after the pform is
@@ -131,7 +212,7 @@ the defparam overrides are applied to the parameters.
3.3.2 Netlist Elaboration
After the scopes and parameters are generated and the NetScope tree
fully formed, the elaboration runs through teh pform again, this time
fully formed, the elaboration runs through the pform again, this time
generating the structural and behavioral netlist. Parameters are
elaborated and evaluated by now so all the constants of code
generation are now known locally, so the netlist can be generated by
@@ -141,108 +222,34 @@ simply passing through the pform.
This is actually a collection of processing steps that perform
optimizations that do not depend on the target technology. Examples of
some useful transformations would be,
some useful transformations are
- eliminate null effect circuitry,
- eliminate null effect circuitry
- combinational reduction
- Constant propagation
- constant propagation
The actual functions performed are specified on the command line by
the -F flags (See below).
The actual functions performed are specified on the ivl command line by
the -F flags (see below).
3.5 Code Generation
This step takes the design netlist and uses it to drive the code
generator. (See target.h.) This may require transforming the
generator (see target.h). This may require transforming the
design to suit the technology.
The emit() method of the Design class performs this step. It runs
through the design elements, calling target functions as need arises
to generate actual output.
The target code generator to used is given by the -t flag on the
The user selects the target code generator with the -t flag on the
command line.
4.0 Running Verilog
3.6 ATTRIBUTES
The preferred way to invoke the compiler with the verilog(1)
command. This program invokes the preprocessor (ivlpp) and the
compiler (ivl) with the proper command line options to get the job
done in a friendly way. See the verilog(1) man page for usage details.
NOTE: The $attribute syntax will soon be deprecated in favor of the
Verilog-2001 attribute syntax, which is cleaner and standardized.
4.1 Running IVL Directly
The ivl command is the compiler driver, that invokes the parser,
optimization functions and the code generator.
Usage: ivl <options>... file
ivl -h
-F <name>
Use this flag to request an optimization function be applied
to the netlist before it is sent to the target output
stage. Any number of -F options may be given, to specify a
variety of processing steps. The steps will be applied in
order, with the output of one uses as the input to the next.
The function is specified by name. Use the "ivl -h" command to
get a list of configured function names.
-f <assign>
Use this flag to set a parameter value. The format of the
assignment is <key>=<value> where key is any string up to the
first '=', and <value> is the rest of the option. If the '='
is omitted, then the key is assigned the empty string.
The useful keys are defined by the functions and the target in
use. These assignments are specifically useful for passing
target specific information to the target back-end, or
options/parameters to optimization functions, if any are defined.
-m <module>
Cause a named VPI module to be included in the module
list. This parameter appends the named module to the end of
the VPI_MODULE_LIST. This is an ordered list of modules to be
loaded into the simulation at runtime.
This list can also be set with -fVPI_MODULE_LIST=<list> which
sets the list completely. Then, -m after this will append
module names to the list sp specified. The default list
includes "system".
-N <file>
Dump the elaborated netlist to the named file. The netlist is
the folly elaborated netlist, after all the function modules
are applied and right before the output generator is
called. This is an aid for debugging the compiler, and the
output generator in particular.
-o <file>
Normally, the generated result is sent to standard
output. Use the -o flag to specify an output file for the
generated result.
-P <file>
Write the PForm of the parsed input to the specified file.
The pform is the compiler's understanding of the input after
parsing and before elaboration. This is an aid for debugging
the compiler.
-s <module>
Normally, ivl will elaborate the only module in the source
file. If there are multiple modules, use this option to select
the module to be used as the top-level module.
-t <name>
Select the output format for the compiled result. Use the
"ivl -h" command to get a list of configured targets.
-v
Print version and copyright information for ivl.
ATTRIBUTES
The parser accepts as an extension to Verilog the $attribute module
The parser accepts, as an extension to Verilog, the $attribute module
item. The syntax of the $attribute item is:
$attribute (<identifier>, <key>, <value>);
@@ -265,21 +272,32 @@ names a primitive earlier in the compilation unit and the statement is
placed in global scope, instead of within a module. The semicolon is
not part of a type attribute.
Currently, type attributes are only supported for UDP types.
Note that attributes are also occasionally used for communication
between processing steps. Processing steps that are aware of others
may place attributes on netlist objects to communicate information to
later steps.
Icarus Verilog also accepts the Verilog 2001 syntax for
attributes. They have the same general meaning as with the $attribute
syntax, but they are attached to objects by position instead of by
name. Also, the key is a Verilog identifier instead of a string.
4.0 Running iverilog
The preferred way to invoke the compiler is with the iverilog(1)
command. This program invokes the preprocessor (ivlpp) and the
compiler (ivl) with the proper command line options to get the job
done in a friendly way. See the iverilog(1) man page for usage details.
4.1 EXAMPLES
Example: Compiling "hello.vl"
------------------------ hello.vl ----------------------------
module main();
initial
initial
begin
$display("Hi there");
$finish ;
@@ -289,105 +307,190 @@ endmodule
--------------------------------------------------------------
Insure that "verilog" is on your search path, and the vpi library
Ensure that "iverilog" is on your search path, and the vpi library
is available.
For csh -
To compile the program:
setenv PATH /usr/local/bin:$PATH
setenv VPI_MODULE_PATH /usr/local/lib/ivl
verilog hello.vl
iverilog hello.vl
(The above presumes that /usr/local/include and /usr/local/lib are
part of the compiler search path, which is usually the case for gcc.)
To run the program
To run the program:
./hello
./a.out
You can use the "-o" switch to name the output command to be generated
by the compiler. See the iverilog(1) man page.
5.0 Unsupported Constructs
IVL is in development - as such it still only supports a (growing) subset
of verilog. Below is a description of some of the currently unsupported
verilog features. This list is not exhaustive, and does not account
for errors in the compiler. See the Icarus Verilog web page for the
current state of support for Verilog.
Icarus Verilog is in development - as such it still only supports a
(growing) subset of Verilog. Below is a description of some of the
currently unsupported Verilog features. This list is not exhaustive,
and does not account for errors in the compiler. See the Icarus
Verilog web page for the current state of support for Verilog, and in
particular, browse the bug report database for reported unsupported
constructs.
- Min/Typ/Max expressions: Example: a = (1 : 6 : 14);
- System functions are supported, but the return value is a little
tricky. See SYSTEM FUNCTION TABLE FILES in the iverilog man page.
- `timescale directive
- Specify blocks are parsed but ignored in general.
- force/release/assign/deassign procedural assignments not
supported.
- trireg is not supported. tri0 and tri1 are supported.
- block disable not supported, i.e.:
- tran primitives, i.e. tran, tranif1, tranif0, rtran, rtranif1
and rtranif0 are not supported.
begin : foo
[...]
disable foo; // sorry
[...]
end
- Net delays, of the form "wire #N foo;" do not work. Delays in
every other context do work properly, including the V2001 form
"wire #5 foo = bar;"
- fork/join is not supported in vvm runtime
- Event controls inside non-blocking assignments are not supported.
i.e.: a <= @(posedge clk) b;
- Functions in structural contexts are not supported.
- Macro arguments are not supported. `define macros are supported,
but they cannot take arguments.
assign foo = user_function(a,b); // sorry
always @(a or b) foo = user_function(a,b); // OK
5.1 Nonstandard Constructs or Behaviors
- multiplicative operators (*, /, %) are not supported in
general. They do work if the compiler can evaluate them at compile
time.
Icarus Verilog includes some features that are not part of the
IEEE1364 standard, but have well defined meaning, and also sometimes
gives nonstandard (but extended) meanings to some features of the
language that are defined. See the "extensions.txt" documentation for
more details.
assign foo = a * b; // sorry
always @(a or b) foo = a * b; // sorry
$is_signed(<expr>)
This system function returns 1 if the expression contained is
signed, or 0 otherwise. This is mostly of use for compiler
regression tests.
- event data type is not supported.
$sizeof(<expr>)
$bits(<expr>)
The $bits system function returns the size in bits of the
expression that is its argument. The result of this
function is undefined if the argument doesn't have a
self-determined size.
- real data type not supported.
The $sizeof function is deprecated in favor of $bits, which is
the same thing, but included in the SystemVerilog definition.
- system functions are not supported. (User defined functions are
supported, and system tasks are supported.)
$simtime
The $simtime system function returns as a 64bit value the
simulation time, unscaled by the time units of local
scope. This is different from the $time and $stime functions
which return the scaled times. This function is added for
regression testing of the compiler and run time, but can be
used by applications who really want the simulation time.
assign foo = $some_function(a,b); // sorry
always @(a or b) foo = $some_function(a,b); // sorry
Note that the simulation time can be confusing if there are
lots of different `timescales within a design. It is not in
general possible to predict what the simulation precision will
turn out to be.
- non-constant delay expressions, i.e.:
$mti_random()
$mti_dist_uniform
These functions are similar to the IEEE1364 standard $random
functions, but they use the Mersenne Twister (MT19937)
algorithm. This is considered an excellent random number
generator, but does not generate the same sequence as the
standardized $random.
reg [7:0] del;
always #(reg) $display($time,,"del = %d", del); // sorry
Builtin system functions
- drive strengths are parsed, bug ignored.
Certain of the system functions have well defined meanings, so
can theoretically be evaluated at compile time, instead of
using runtime VPI code. Doing so means that VPI cannot
override the definitions of functions handled in this
manner. On the other hand, this makes them synthesizable, and
also allows for more aggressive constant propagation. The
functions handled in this manner are:
Specify blocks are parsed but ignored in general.
$bits
$signed
$sizeof
$unsigned
Implementations of these system functions in VPI modules will
be ignored.
Preprocessing Library Modules
Icarus Verilog does preprocess modules that are loaded from
libraries via the -y mechanism. However, the only macros
defined during compilation of that file are those that it
defines itself (or includes) or that are defined on the
command line or command file.
Specifically, macros defined in the non-library source files
are not remembered when the library module is loaded. This is
intentional. If it were otherwise, then compilation results
might vary depending on the order that libraries are loaded,
and that is too unpredictable.
It is said that some commercial compilers do allow macro
definitions to span library modules. That's just plain weird.
Width in %t Time Formats
Standard Verilog does not allow width fields in the %t formats
of display strings. For example, this is illegal:
$display("Time is %0t", %time);
Standard Verilog instead relies on the $timeformat to
completely specify the format.
Icarus Verilog allows the programmer to specify the field
width. The "%t" format in Icarus Verilog works exactly as it
does in standard Verilog. However, if the programmer chooses
to specify a minimum width (i.e., "%5t"), then for that display
Icarus Verilog will override the $timeformat minimum width and
use the explicit minimum width.
vpiScope iterator on vpiScope objects.
In the VPI, the normal way to iterate over vpiScope objects
contained within a vpiScope object, is the vpiInternalScope
iterator. Icarus Verilog adds support for the vpiScope
iterator of a vpiScope object, that iterates over *everything*
the is contained in the current scope. This is useful in cases
where one wants to iterate over all the objects in a scope
without iterating over all the contained types explicitly.
time 0 race resolution.
Combinational logic is routinely modeled using always
blocks. However, this can lead to race conditions if the
inputs to the combinational block are initialized in initial
statements. Icarus Verilog slightly modifies time 0 scheduling
by arranging for always statements with ANYEDGE sensitivity
lists to be scheduled before any other threads. This causes
combinational always blocks to be triggered when the values in
the sensitivity list are initialized by initial threads.
Nets with Types
Icarus Verilog support an extension syntax that allows nets
and regs to be explicitly typed. The currently supported types
are logic, bool and real. This implies that "logic" and "bool"
are new keywords. Typical syntax is:
wire real foo = 1.0;
reg logic bar, bat;
... and so forth. The syntax can be turned off by using the
-g2 flag to iverilog, and turned on explicitly with the -g2x
flag to iverilog.
6.0 CREDITS
Except where otherwise noted, ivl and ivlpp are Copyright Stephen
Williams. The proper notices are in the head of each file. However,
I have received aid in the form of fixes, Verilog guidance, and
especially testing from many people, including (in alphabetical order):
Except where otherwise noted, Icarus Verilog, ivl and ivlpp are
Copyright Stephen Williams. The proper notices are in the head of each
file. However, I have early on received aid in the form of fixes,
Verilog guidance, and especially testing from many people. Testers in
particular include a larger community of people interested in a GPL
Verilog for Linux.
Eric Aardoom <[email protected]>
Stephan I. Boettcher <[email protected]>
Ed Carter <[email protected]>
Larry Doolittle <[email protected]>
Guy Hutchison <[email protected]>
Ales Hvezda <[email protected]>
Yasuhisa Kato <[email protected]>
James Lee <[email protected]>
Peter Monta <[email protected]>
Daniel H. Nelsen <[email protected]>
Stefan Petersen <[email protected]>
Jason Schonberg <[email protected]>
Stuart Sutherland <[email protected]>
Stephen Tell <[email protected]>
Stefan Theide <[email protected]>
Steve Wilson <[email protected]>
and others. Testers in particular include a larger community of people
interested in a GPL Verilog for Linux. Special thanks to Steve Wilson
for collecting and organizing the test suite code for all those testers.
+100 -94
View File
@@ -16,10 +16,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: Statement.cc,v 1.20 2000/04/22 04:20:19 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: Statement.cc,v 1.30 2007/05/24 04:07:11 steve Exp $"
#endif
# include "config.h"
# include "Statement.h"
# include "PExpr.h"
@@ -30,17 +32,19 @@ Statement::~Statement()
PAssign_::PAssign_(PExpr*lval, PExpr*ex)
: event_(0), lval_(lval), rval_(ex)
{
delay_ = 0;
}
PAssign_::PAssign_(PExpr*lval, PExpr*de, PExpr*ex)
: event_(0), lval_(lval), rval_(ex)
{
if (de) delay_.set_delay(de);
delay_ = de;
}
PAssign_::PAssign_(PExpr*lval, PEventStatement*ev, PExpr*ex)
: event_(ev), lval_(lval), rval_(ex)
{
delay_ = 0;
}
PAssign_::~PAssign_()
@@ -82,7 +86,7 @@ PAssignNB::~PAssignNB()
{
}
PBlock::PBlock(const string&n, BL_TYPE t, const svector<Statement*>&st)
PBlock::PBlock(perm_string n, BL_TYPE t, const svector<Statement*>&st)
: name_(n), bl_type_(t), list_(st)
{
}
@@ -103,11 +107,26 @@ PBlock::~PBlock()
delete list_[idx];
}
PCallTask::PCallTask(const string&n, const svector<PExpr*>&p)
: name_(n), parms_(p)
PCallTask::PCallTask(const pform_name_t&n, const svector<PExpr*>&p)
: path_(n), parms_(p)
{
}
PCallTask::PCallTask(perm_string n, const svector<PExpr*>&p)
: parms_(p)
{
path_.push_back(name_component_t(n));
}
PCallTask::~PCallTask()
{
}
const pform_name_t& PCallTask::path() const
{
return path_;
}
PCase::PCase(NetCase::TYPE t, PExpr*ex, svector<PCase::Item*>*l)
: type_(t), expr_(ex), items_(l)
{
@@ -122,6 +141,17 @@ PCase::~PCase()
delete[]items_;
}
PCAssign::PCAssign(PExpr*l, PExpr*r)
: lval_(l), expr_(r)
{
}
PCAssign::~PCAssign()
{
delete lval_;
delete expr_;
}
PCondit::PCondit(PExpr*ex, Statement*i, Statement*e)
: expr_(ex), if_(i), else_(e)
{
@@ -134,6 +164,16 @@ PCondit::~PCondit()
delete else_;
}
PDeassign::PDeassign(PExpr*l)
: lval_(l)
{
}
PDeassign::~PDeassign()
{
delete lval_;
}
PDelayStatement::PDelayStatement(PExpr*d, Statement*st)
: delay_(d), statement_(st)
@@ -144,10 +184,19 @@ PDelayStatement::~PDelayStatement()
{
}
PDisable::PDisable(const pform_name_t&sc)
: scope_(sc)
{
}
PDisable::~PDisable()
{
}
PEventStatement::PEventStatement(const svector<PEEvent*>&ee)
: expr_(ee), statement_(0)
{
assert(expr_.count() > 0);
}
@@ -157,6 +206,11 @@ PEventStatement::PEventStatement(PEEvent*ee)
expr_[0] = ee;
}
PEventStatement::PEventStatement(void)
: statement_(0)
{
}
PEventStatement::~PEventStatement()
{
// delete the events and the statement?
@@ -188,6 +242,17 @@ PForever::~PForever()
delete statement_;
}
PForStatement::PForStatement(PExpr*n1, PExpr*e1, PExpr*cond,
PExpr*n2, PExpr*e2, Statement*st)
: name1_(n1), expr1_(e1), cond_(cond), name2_(n2), expr2_(e2),
statement_(st)
{
}
PForStatement::~PForStatement()
{
}
PProcess::~PProcess()
{
delete statement_;
@@ -214,7 +279,7 @@ PRepeat::~PRepeat()
delete statement_;
}
PTrigger::PTrigger(const string&e)
PTrigger::PTrigger(const pform_name_t&e)
: event_(e)
{
}
@@ -223,6 +288,11 @@ PTrigger::~PTrigger()
{
}
PWhile::PWhile(PExpr*e1, Statement*st)
: cond_(e1), statement_(st)
{
}
PWhile::~PWhile()
{
delete cond_;
@@ -231,99 +301,35 @@ PWhile::~PWhile()
/*
* $Log: Statement.cc,v $
* Revision 1.20 2000/04/22 04:20:19 steve
* Add support for force assignment.
* Revision 1.30 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.19 2000/04/12 04:23:57 steve
* Named events really should be expressed with PEIdent
* objects in the pform,
* Revision 1.29 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Handle named events within the mix of net events
* and edges. As a unified lot they get caught together.
* wait statements are broken into more complex statements
* that include a conditional.
* Revision 1.28 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Do not generate NetPEvent or NetNEvent objects in
* elaboration. NetEvent, NetEvWait and NetEvProbe
* take over those functions in the netlist.
* Revision 1.27 2002/04/21 22:31:02 steve
* Redo handling of assignment internal delays.
* Leave it possible for them to be calculated
* at run time.
*
* Revision 1.18 2000/04/01 19:31:57 steve
* Named events as far as the pform.
* Revision 1.26 2002/04/21 04:59:07 steve
* Add support for conbinational events by finding
* the inputs to expressions and some statements.
* Get case and assignment statements working.
*
* Revision 1.17 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
* Revision 1.25 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.16 1999/09/29 18:36:02 steve
* Full case support
*
* Revision 1.15 1999/09/22 02:00:48 steve
* assignment with blocking event delay.
*
* Revision 1.14 1999/09/04 19:11:46 steve
* Add support for delayed non-blocking assignments.
*
* Revision 1.13 1999/09/02 01:59:27 steve
* Parse non-blocking assignment delays.
*
* Revision 1.12 1999/07/12 00:59:36 steve
* procedural blocking assignment delays.
*
* Revision 1.11 1999/06/24 04:24:18 steve
* Handle expression widths for EEE and NEE operators,
* add named blocks and scope handling,
* add registers declared in named blocks.
*
* Revision 1.10 1999/06/19 21:06:16 steve
* Elaborate and supprort to vvm the forever
* and repeat statements.
*
* Revision 1.9 1999/06/15 05:38:39 steve
* Support case expression lists.
*
* Revision 1.8 1999/06/13 23:51:16 steve
* l-value part select for procedural assignments.
*
* Revision 1.7 1999/06/06 20:45:38 steve
* Add parse and elaboration of non-blocking assignments,
* Replace list<PCase::Item*> with an svector version,
* Add integer support.
*
* Revision 1.6 1999/05/10 00:16:58 steve
* Parse and elaborate the concatenate operator
* in structural contexts, Replace vector<PExpr*>
* and list<PExpr*> with svector<PExpr*>, evaluate
* constant expressions with parameters, handle
* memories as lvalues.
*
* Parse task declarations, integer types.
*
* Revision 1.5 1999/02/03 04:20:11 steve
* Parse and elaborate the Verilog CASE statement.
*
* Revision 1.4 1999/01/25 05:45:56 steve
* Add the LineInfo class to carry the source file
* location of things. PGate, Statement and PProcess.
*
* elaborate handles module parameter mismatches,
* missing or incorrect lvalues for procedural
* assignment, and errors are propogated to the
* top of the elaboration call tree.
*
* Attach line numbers to processes, gates and
* assignment statements.
*
* Revision 1.3 1998/11/11 03:13:04 steve
* Handle while loops.
*
* Revision 1.2 1998/11/07 17:05:05 steve
* Handle procedural conditional, and some
* of the conditional expressions.
*
* Elaborate signals and identifiers differently,
* allowing the netlist to hold signal information.
*
* Revision 1.1 1998/11/03 23:28:55 steve
* Introduce verilog to CVS.
* Revision 1.24 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.23 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*/
+167 -142
View File
@@ -18,19 +18,25 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: Statement.h,v 1.25 2000/04/22 04:20:19 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: Statement.h,v 1.44 2007/05/24 04:07:11 steve Exp $"
#endif
# include <string>
# include "svector.h"
# include "StringHeap.h"
# include "PDelays.h"
# include "PExpr.h"
# include "HName.h"
# include "LineInfo.h"
class PExpr;
class Statement;
class PEventStatement;
class Design;
class NetAssign_;
class NetCAssign;
class NetDeassign;
class NetForce;
class NetScope;
/*
@@ -49,9 +55,13 @@ class PProcess : public LineInfo {
virtual ~PProcess();
bool elaborate(Design*des, NetScope*scope) const;
Type type() const { return type_; }
Statement*statement() { return statement_; }
map<perm_string,PExpr*> attributes;
virtual void dump(ostream&out, unsigned ind) const;
private:
@@ -71,7 +81,7 @@ class Statement : public LineInfo {
virtual ~Statement() =0;
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
};
@@ -91,11 +101,9 @@ class PAssign_ : public Statement {
const PExpr* rval() const { return rval_; }
protected:
NetNet*elaborate_lval(Design*, const string&path,
unsigned&lsb, unsigned&msb,
NetExpr*&mux) const;
NetAssign_* elaborate_lval(Design*, NetScope*scope) const;
PDelays delay_;
PExpr* delay_;
PEventStatement*event_;
private:
@@ -112,11 +120,9 @@ class PAssign : public PAssign_ {
~PAssign();
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
private:
NetProc*assign_to_memory_(class NetMemory*, PExpr*,
Design*des, const string&path) const;
};
class PAssignNB : public PAssign_ {
@@ -127,11 +133,11 @@ class PAssignNB : public PAssign_ {
~PAssignNB();
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
private:
NetProc*assign_to_memory_(class NetMemory*, PExpr*,
Design*des, const string&path) const;
Design*des, NetScope*scope) const;
};
/*
@@ -146,22 +152,20 @@ class PBlock : public Statement {
public:
enum BL_TYPE { BL_SEQ, BL_PAR };
explicit PBlock(const string&n, BL_TYPE t, const svector<Statement*>&st);
explicit PBlock(perm_string n, BL_TYPE t, const svector<Statement*>&st);
explicit PBlock(BL_TYPE t, const svector<Statement*>&st);
explicit PBlock(BL_TYPE t);
~PBlock();
BL_TYPE bl_type() const { return bl_type_; }
//unsigned size() const { return list_.count(); }
//const Statement*stat(unsigned idx) const { return list_[idx]; }
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
private:
string name_;
perm_string name_;
const BL_TYPE bl_type_;
svector<Statement*>list_;
};
@@ -169,9 +173,11 @@ class PBlock : public Statement {
class PCallTask : public Statement {
public:
explicit PCallTask(const string&n, const svector<PExpr*>&parms);
explicit PCallTask(const pform_name_t&n, const svector<PExpr*>&parms);
explicit PCallTask(perm_string n, const svector<PExpr*>&parms);
~PCallTask();
string name() const { return name_; }
const pform_name_t& path() const;
unsigned nparms() const { return parms_.count(); }
@@ -186,13 +192,13 @@ class PCallTask : public Statement {
}
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
private:
NetProc* elaborate_sys(Design*des, const string&path) const;
NetProc* elaborate_usr(Design*des, const string&path) const;
NetProc* elaborate_sys(Design*des, NetScope*scope) const;
NetProc* elaborate_usr(Design*des, NetScope*scope) const;
const string name_;
pform_name_t path_;
svector<PExpr*> parms_;
};
@@ -207,7 +213,7 @@ class PCase : public Statement {
PCase(NetCase::TYPE, PExpr*ex, svector<Item*>*);
~PCase();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
@@ -222,13 +228,27 @@ class PCase : public Statement {
PCase& operator= (const PCase&);
};
class PCAssign : public Statement {
public:
explicit PCAssign(PExpr*l, PExpr*r);
~PCAssign();
virtual NetCAssign* elaborate(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
private:
PExpr*lval_;
PExpr*expr_;
};
class PCondit : public Statement {
public:
PCondit(PExpr*ex, Statement*i, Statement*e);
~PCondit();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
@@ -242,6 +262,19 @@ class PCondit : public Statement {
PCondit& operator= (const PCondit&);
};
class PDeassign : public Statement {
public:
explicit PDeassign(PExpr*l);
~PDeassign();
virtual NetDeassign* elaborate(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
private:
PExpr*lval_;
};
class PDelayStatement : public Statement {
public:
@@ -249,7 +282,7 @@ class PDelayStatement : public Statement {
~PDelayStatement();
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
private:
@@ -257,12 +290,30 @@ class PDelayStatement : public Statement {
Statement*statement_;
};
/*
* This represents the parsing of a disable <scope> statement.
*/
class PDisable : public Statement {
public:
explicit PDisable(const pform_name_t&sc);
~PDisable();
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
private:
pform_name_t scope_;
};
/*
* The event statement represents the event delay in behavioral
* code. It comes from such things as:
*
* @name <statement>;
* @(expr) <statement>;
* @* <statement>;
*/
class PEventStatement : public Statement {
@@ -270,18 +321,22 @@ class PEventStatement : public Statement {
explicit PEventStatement(const svector<PEEvent*>&ee);
explicit PEventStatement(PEEvent*ee);
// Make an @* statement.
explicit PEventStatement(void);
~PEventStatement();
void set_statement(Statement*st);
virtual void dump(ostream&out, unsigned ind) const;
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
// This method is used to elaborate, but attach a previously
// elaborated statement to the event.
NetProc* elaborate_st(Design*des, const string&path, NetProc*st) const;
NetProc* elaborate_st(Design*des, NetScope*scope, NetProc*st) const;
NetProc* elaborate_wait(Design*des, NetScope*scope, NetProc*st) const;
private:
svector<PEEvent*>expr_;
@@ -294,7 +349,7 @@ class PForce : public Statement {
explicit PForce(PExpr*l, PExpr*r);
~PForce();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetForce* elaborate(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
private:
@@ -307,7 +362,7 @@ class PForever : public Statement {
explicit PForever(Statement*s);
~PForever();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
@@ -319,12 +374,10 @@ class PForStatement : public Statement {
public:
PForStatement(PExpr*n1, PExpr*e1, PExpr*cond,
PExpr*n2, PExpr*e2, Statement*st)
: name1_(n1), expr1_(e1), cond_(cond), name2_(n2), expr2_(e2),
statement_(st)
{ }
PExpr*n2, PExpr*e2, Statement*st);
~PForStatement();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
@@ -344,6 +397,7 @@ class PNoop : public Statement {
public:
PNoop() { }
~PNoop() { }
};
class PRepeat : public Statement {
@@ -351,7 +405,7 @@ class PRepeat : public Statement {
explicit PRepeat(PExpr*expr, Statement*s);
~PRepeat();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
@@ -366,7 +420,7 @@ class PRelease : public Statement {
explicit PRelease(PExpr*l);
~PRelease();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
private:
@@ -380,24 +434,23 @@ class PRelease : public Statement {
class PTrigger : public Statement {
public:
explicit PTrigger(const string&ev);
explicit PTrigger(const pform_name_t&ev);
~PTrigger();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
private:
string event_;
pform_name_t event_;
};
class PWhile : public Statement {
public:
PWhile(PExpr*e1, Statement*st)
: cond_(e1), statement_(st) { }
PWhile(PExpr*e1, Statement*st);
~PWhile();
virtual NetProc* elaborate(Design*des, const string&path) const;
virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void elaborate_scope(Design*des, NetScope*scope) const;
virtual void dump(ostream&out, unsigned ind) const;
@@ -408,6 +461,77 @@ class PWhile : public Statement {
/*
* $Log: Statement.h,v $
* Revision 1.44 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.43 2007/03/05 05:59:10 steve
* Handle processes within generate loops.
*
* Revision 1.42 2005/12/05 21:21:18 steve
* Fixes for stubborn compilers.
*
* Revision 1.41 2004/12/11 02:31:25 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
* down this path.
*
* Revision 1.40 2004/02/20 18:53:33 steve
* Addtrbute keys are perm_strings.
*
* Revision 1.39 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.38 2003/05/19 02:50:58 steve
* Implement the wait statement behaviorally instead of as nets.
*
* Revision 1.37 2003/01/30 16:23:07 steve
* Spelling fixes.
*
* Revision 1.36 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.35 2002/06/04 05:38:44 steve
* Add support for memory words in l-value of
* blocking assignments, and remove the special
* NetAssignMem class.
*
* Revision 1.34 2002/05/26 01:39:02 steve
* Carry Verilog 2001 attributes with processes,
* all the way through to the ivl_target API.
*
* Divide signal reference counts between rval
* and lval references.
*
* Revision 1.33 2002/04/21 22:31:02 steve
* Redo handling of assignment internal delays.
* Leave it possible for them to be calculated
* at run time.
*
* Revision 1.32 2002/04/21 04:59:07 steve
* Add support for conbinational events by finding
* the inputs to expressions and some statements.
* Get case and assignment statements working.
*
* Revision 1.31 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.30 2001/11/22 06:20:59 steve
* Use NetScope instead of string for scope path.
*
* Revision 1.29 2000/09/09 15:21:26 steve
* move lval elaboration to PExpr virtual methods.
*
* Revision 1.28 2000/09/03 17:58:35 steve
* Change elaborate_lval to return NetAssign_ objects.
*
* Revision 1.27 2000/07/26 05:08:07 steve
* Parse disable statements to pform.
*
* Revision 1.26 2000/05/11 23:37:26 steve
* Add support for procedural continuous assignment.
*
* Revision 1.25 2000/04/22 04:20:19 steve
* Add support for force assignment.
*
@@ -423,104 +547,5 @@ class PWhile : public Statement {
* Do not generate NetPEvent or NetNEvent objects in
* elaboration. NetEvent, NetEvWait and NetEvProbe
* take over those functions in the netlist.
*
* Revision 1.23 2000/04/01 19:31:57 steve
* Named events as far as the pform.
*
* Revision 1.22 2000/03/11 03:25:51 steve
* Locate scopes in statements.
*
* Revision 1.21 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
*
* Revision 1.20 1999/09/29 18:36:02 steve
* Full case support
*
* Revision 1.19 1999/09/22 02:00:48 steve
* assignment with blocking event delay.
*
* Revision 1.18 1999/09/15 01:55:06 steve
* Elaborate non-blocking assignment to memories.
*
* Revision 1.17 1999/09/04 19:11:46 steve
* Add support for delayed non-blocking assignments.
*
* Revision 1.16 1999/09/02 01:59:27 steve
* Parse non-blocking assignment delays.
*
* Revision 1.15 1999/07/12 00:59:36 steve
* procedural blocking assignment delays.
*
* Revision 1.14 1999/07/03 02:12:51 steve
* Elaborate user defined tasks.
*
* Revision 1.13 1999/06/24 04:24:18 steve
* Handle expression widths for EEE and NEE operators,
* add named blocks and scope handling,
* add registers declared in named blocks.
*
* Revision 1.12 1999/06/19 21:06:16 steve
* Elaborate and supprort to vvm the forever
* and repeat statements.
*
* Revision 1.11 1999/06/15 05:38:39 steve
* Support case expression lists.
*
* Revision 1.10 1999/06/13 23:51:16 steve
* l-value part select for procedural assignments.
*
* Revision 1.9 1999/06/06 20:45:38 steve
* Add parse and elaboration of non-blocking assignments,
* Replace list<PCase::Item*> with an svector version,
* Add integer support.
*
* Revision 1.8 1999/05/10 00:16:58 steve
* Parse and elaborate the concatenate operator
* in structural contexts, Replace vector<PExpr*>
* and list<PExpr*> with svector<PExpr*>, evaluate
* constant expressions with parameters, handle
* memories as lvalues.
*
* Parse task declarations, integer types.
*
* Revision 1.7 1999/04/29 02:16:26 steve
* Parse OR of event expressions.
*
* Revision 1.6 1999/02/03 04:20:11 steve
* Parse and elaborate the Verilog CASE statement.
*
* Revision 1.5 1999/01/25 05:45:56 steve
* Add the LineInfo class to carry the source file
* location of things. PGate, Statement and PProcess.
*
* elaborate handles module parameter mismatches,
* missing or incorrect lvalues for procedural
* assignment, and errors are propogated to the
* top of the elaboration call tree.
*
* Attach line numbers to processes, gates and
* assignment statements.
*
* Revision 1.4 1998/11/11 03:13:04 steve
* Handle while loops.
*
* Revision 1.3 1998/11/09 18:55:33 steve
* Add procedural while loops,
* Parse procedural for loops,
* Add procedural wait statements,
* Add constant nodes,
* Add XNOR logic gate,
* Make vvm output look a bit prettier.
*
* Revision 1.2 1998/11/07 17:05:05 steve
* Handle procedural conditional, and some
* of the conditional expressions.
*
* Elaborate signals and identifiers differently,
* allowing the netlist to hold signal information.
*
* Revision 1.1 1998/11/03 23:28:56 steve
* Introduce verilog to CVS.
*
*/
#endif
+206
View File
@@ -0,0 +1,206 @@
/*
* Copyright (c) 2002-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: StringHeap.cc,v 1.6 2004/02/18 17:11:54 steve Exp $"
#endif
# include "StringHeap.h"
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
# include <stdlib.h>
# include <string.h>
# include <assert.h>
StringHeap::StringHeap()
{
cell_base_ = 0;
cell_ptr_ = HEAPCELL;
cell_count_ = 0;
}
StringHeap::~StringHeap()
{
// This is a planned memory leak. The string heap is intended
// to hold permanently-allocated strings.
}
const char* StringHeap::add(const char*text)
{
unsigned len = strlen(text);
assert((len+1) <= HEAPCELL);
unsigned rem = HEAPCELL - cell_ptr_;
if (rem < (len+1)) {
cell_base_ = (char*)malloc(HEAPCELL);
cell_ptr_ = 0;
cell_count_ += 1;
assert(cell_base_ != 0);
}
char*res = cell_base_ + cell_ptr_;
memcpy(res, text, len);
cell_ptr_ += len;
cell_base_[cell_ptr_++] = 0;
assert(cell_ptr_ <= HEAPCELL);
return res;
}
perm_string StringHeap::make(const char*text)
{
return perm_string(add(text));
}
StringHeapLex::StringHeapLex()
{
hit_count_ = 0;
add_count_ = 0;
for (unsigned idx = 0 ; idx < HASH_SIZE ; idx += 1)
hash_table_[idx] = 0;
}
StringHeapLex::~StringHeapLex()
{
}
unsigned StringHeapLex::add_hit_count() const
{
return hit_count_;
}
unsigned StringHeapLex::add_count() const
{
return add_count_;
}
static unsigned hash_string(const char*text)
{
unsigned h = 0;
while (*text) {
h = (h << 4) ^ (h >> 28) ^ *text;
text += 1;
}
return h;
}
const char* StringHeapLex::add(const char*text)
{
unsigned hash_value = hash_string(text) % HASH_SIZE;
/* If we easily find the string in the hash table, then return
that and be done. */
if (hash_table_[hash_value]
&& (strcmp(hash_table_[hash_value], text) == 0)) {
hit_count_ += 1;
return hash_table_[hash_value];
}
/* The existing hash entry is not a match. Replace it with the
newly allocated value, and return the new pointer as the
result to the add. */
const char*res = StringHeap::add(text);
hash_table_[hash_value] = res;
add_count_ += 1;
return res;
}
perm_string StringHeapLex::make(const char*text)
{
return perm_string(add(text));
}
perm_string StringHeapLex::make(const string&text)
{
return perm_string(add(text.c_str()));
}
bool operator == (perm_string a, const char*b)
{
if (a.str() == b)
return true;
if (! (a.str() && b))
return false;
if (strcmp(a.str(), b) == 0)
return true;
return false;
}
bool operator == (perm_string a, perm_string b)
{
return a == b.str();
}
bool operator != (perm_string a, const char*b)
{
return ! (a == b);
}
bool operator != (perm_string a, perm_string b)
{
return ! (a == b);
}
bool operator < (perm_string a, perm_string b)
{
if (b.str() && !a.str())
return true;
if (b.str() == a.str())
return false;
if (strcmp(a.str(), b.str()) < 0)
return true;
return false;
}
/*
* $Log: StringHeap.cc,v $
* Revision 1.6 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.5 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
* into this table. Also, permallocate event
* names from the beginning.
*
* Revision 1.4 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.3 2003/01/16 21:44:46 steve
* Keep some debugging status.
*
* Revision 1.2 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/08/04 19:13:16 steve
* dll uses StringHeap for named items.
*
*/
+147
View File
@@ -0,0 +1,147 @@
#ifndef __StringHeap_H
#define __StringHeap_H
/*
* Copyright (c) 2002-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: StringHeap.h,v 1.6 2005/06/14 19:13:43 steve Exp $"
#endif
# include "config.h"
# include <string>
using namespace std;
class perm_string {
public:
perm_string() : text_(0) { }
perm_string(const perm_string&that) : text_(that.text_) { }
~perm_string() { }
perm_string& operator = (const perm_string&that)
{ text_ = that.text_; return *this; }
const char*str() const { return text_; }
operator const char* () const { return str(); }
// This is an escape for making perm_string objects out of
// literals. For example, per_string::literal("Label"); Please
// do *not* cheat and pass arbitrary const char* items here.
static perm_string literal(const char*t) { return perm_string(t); }
private:
friend class StringHeap;
friend class StringHeapLex;
perm_string(const char*t) : text_(t) { };
private:
const char*text_;
};
extern bool operator == (perm_string a, perm_string b);
extern bool operator == (perm_string a, const char* b);
extern bool operator != (perm_string a, perm_string b);
extern bool operator != (perm_string a, const char* b);
extern bool operator > (perm_string a, perm_string b);
extern bool operator < (perm_string a, perm_string b);
extern bool operator >= (perm_string a, perm_string b);
extern bool operator <= (perm_string a, perm_string b);
/*
* The string heap is a way to permanently allocate strings
* efficiently. They only take up the space of the string characters
* and the terminating nul, there is no malloc overhead.
*/
class StringHeap {
public:
StringHeap();
~StringHeap();
const char*add(const char*);
perm_string make(const char*);
private:
enum { HEAPCELL = 0x10000 };
char*cell_base_;
unsigned cell_ptr_;
unsigned cell_count_;
private: // not implemented
StringHeap(const StringHeap&);
StringHeap& operator= (const StringHeap&);
};
/*
* A lexical string heap is a string heap that makes an effort to
* return the same pointer for identical strings. This saves further
* space by not allocating duplicate strings, so in a system with lots
* of identifiers, this can theoretically save more space.
*/
class StringHeapLex : private StringHeap {
public:
StringHeapLex();
~StringHeapLex();
const char*add(const char*);
perm_string make(const char*);
perm_string make(const string&);
unsigned add_count() const;
unsigned add_hit_count() const;
private:
enum { HASH_SIZE = 4096 };
const char*hash_table_[HASH_SIZE];
unsigned add_count_;
unsigned hit_count_;
private: // not implemented
StringHeapLex(const StringHeapLex&);
StringHeapLex& operator= (const StringHeapLex&);
};
/*
* $Log: StringHeap.h,v $
* Revision 1.6 2005/06/14 19:13:43 steve
* gcc3/4 compile errors.
*
* Revision 1.5 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.4 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
* into this table. Also, permallocate event
* names from the beginning.
*
* Revision 1.3 2003/01/16 21:44:46 steve
* Keep some debugging status.
*
* Revision 1.2 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/08/04 19:13:16 steve
* dll uses StringHeap for named items.
*
*/
#endif
+129
View File
@@ -0,0 +1,129 @@
#ifndef PLI_TYPES
#define PLI_TYPES
/*
* Copyright (c) 2003 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: _pli_types.h.in,v 1.8 2007/06/05 21:32:30 steve Exp $"
#endif
# undef HAVE_INTTYPES_H
#ifdef HAVE_INTTYPES_H
/*
* If the host environment has the stdint.h header file,
* then use that to size our PLI types.
*/
#ifndef __STDC_FORMAT_MACROS
# define __STDC_FORMAT_MACROS
#endif
# include <inttypes.h>
typedef uint64_t PLI_UINT64;
typedef int64_t PLI_INT64;
typedef uint32_t PLI_UINT32;
typedef int32_t PLI_INT32;
typedef signed short PLI_INT16;
typedef unsigned short PLI_UINT16;
typedef char PLI_BYTE8;
typedef unsigned char PLI_UBYTE8;
# define PLI_UINT64_FMT PRIu64
#else
/*
* If we do not have the c99 stdint.h header file, then use
* configure detection to guess the pli types ourselves.
*/
# define SIZEOF_UNSIGNED_LONG_LONG 8
# define SIZEOF_UNSIGNED_LONG 8
# define SIZEOF_UNSIGNED 4
#if SIZEOF_UNSIGNED >= 8
typedef unsigned PLI_UINT64;
typedef int PLI_INT64;
# define PLI_UINT64_FMT "u"
#else
# if SIZEOF_UNSIGNED_LONG >= 8
typedef unsigned long PLI_UINT64;
typedef long PLI_INT64;
# define PLI_UINT64_FMT "lu"
# else
# if SIZEOF_UNSIGNED_LONG_LONG > SIZEOF_UNSIGNED_LONG
typedef unsigned long long PLI_UINT64;
typedef long long PLI_INT64;
# define PLI_UINT64_FMT "llu"
# else
typedef unsigned long PLI_UINT64;
typedef long PLI_INT64;
# define PLI_UINT64_FMT "lu"
# endif
# endif
#endif
typedef signed int PLI_INT32;
typedef unsigned int PLI_UINT32;
typedef signed short PLI_INT16;
typedef unsigned short PLI_UINT16;
typedef char PLI_BYTE8;
typedef unsigned char PLI_UBYTE8;
#endif
/*
* $Log: _pli_types.h.in,v $
* Revision 1.8 2007/06/05 21:32:30 steve
* More standard PLI_BYTE8.
*
* Revision 1.7 2003/11/12 02:38:44 steve
* Clean up manual definitions of PLI_UINT64_FMT.
*
* Revision 1.6 2003/11/08 20:06:21 steve
* Spelling fixes in comments.
*
* Revision 1.5 2003/10/29 03:28:27 steve
* Add the PLU_UINT64_FMT string for formatting output.
*
* Revision 1.4 2003/10/29 03:23:12 steve
* Portably handle time format of VCD prints.
*
* Revision 1.3 2003/10/02 21:30:06 steve
* Use configured TIME_FMT in vcd dump printf.
*
* Revision 1.2 2003/10/02 19:33:44 steve
* Put libraries in libdir64.
*
* Revision 1.1 2003/09/30 01:33:13 steve
* Add PLI_UINT64 to _pli_types.h.
*
* Revision 1.2 2003/05/26 04:39:16 steve
* Typo type name.
*
* Revision 1.1 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
*/
#endif
+354
View File
@@ -0,0 +1,354 @@
#ifndef __acc_user_H
#define __acc_user_H
/*
* Copyright (c) 2002 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: acc_user.h,v 1.20 2003/12/17 15:45:07 steve Exp $"
#endif
/*
* This header file contains the definitions and declarations needed
* by an Icarus Verilog user using acc_ routines.
*
* NOTE: Icarus Verilog does not support acc_ routines. This is just a
* stub. The functions that are implemented here are actually
* implemented using VPI routines.
*/
#ifdef __cplusplus
# define EXTERN_C_START extern "C" {
# define EXTERN_C_END }
#else
# define EXTERN_C_START
# define EXTERN_C_END
# define bool int
#endif
EXTERN_C_START
# include "_pli_types.h"
/*
* This is a declaration of the "handle" type that is compatible with
* the vpiHandle from vpi_user.h. The libveriuser library implements
* the acc handle type as a vpiHandle, to prevent useless indirection.
*/
typedef struct __vpiHandle *handle;
/* OBJECT TYPES */
#define accModule 20
#define accScope 21
#define accNet 25
#define accReg 30
#define accIntegerParam 200
#define accRealParam 202
#define accStringParam 204
#define accParameter 220
#define accTopModule 224
#define accModuleInstance 226
#define accWire 260
#define accNamedEvent 280
#define accIntegerVar 281
#define accRealVar 282
#define accTimeVar 283
#define accIntVar accIntegerVar
#define accScalar 300
#define accVector 302
#define accUnknown 412
#define accConstant 600
/* type VALUES FOR t_setval_delay STRUCTURE */
#define accNoDelay 0
#define accInertialDelay 1
#define accTransportDelay 2
#define accPureTransportDelay 3
#define accForceFlag 4
#define accReleaseFlag 5
/* type VALUES FOR t_setval_value STRUCTURE */
#define accBinStrVal 1
#define accOctStrVal 2
#define accDecStrVal 3
#define accHexStrVal 4
#define accScalarVal 5
#define accIntVal 6
#define accRealVal 7
#define accStringVal 8
#define accVectorVal 9
/* Scalar values */
#define acc0 0
#define acc1 1
#define accX 2
#define accZ 3
/* type VALUES FOR t_acc_time STRUCTURE */
#define accTime 1
#define accSimTime 2
#define accRealTime 3
/* reason codes */
#define logic_value_change 1
#define strength_value_change 2
#define real_value_change 3
#define vector_value_change 4
#define event_value_change 5
#define integer_value_change 6
#define time_value_change 7
#define sregister_value_change 8
#define vregister_value_change 9
#define realtime_value_change 10
/* VCL strength values */
#define vclSupply 7
#define vclStrong 6
#define vclPull 5
#define vclLarge 4
#define vclWeak 3
#define vclMedium 2
#define vclSmall 1
#define vclHighZ 0
/* Constants used by acc_vcl_add */
#define vcl_verilog_logic 2
#define VCL_VERILOG_LOGIC vcl_verilog_logic
#define vcl_verilog_strength 3
#define VCL_VERILOG_STRENGTH vcl_verilog_strength
typedef struct t_acc_time {
int type;
int low, high;
double real;
} s_acc_time, *p_acc_time;
typedef struct t_setval_delay {
s_acc_time time;
int model;
} s_setval_delay, *p_setval_delay;
typedef struct t_acc_vecval {
int aval;
int bval;
} s_acc_vecval, *p_acc_vecval;
typedef struct t_setval_value {
int format;
union {
char*str;
int scalar;
int integer;
double real;
p_acc_vecval vector;
} value;
} s_setval_value, *p_setval_value, s_acc_value, *p_acc_value;
typedef struct t_strengths {
PLI_UBYTE8 logic_value;
PLI_UBYTE8 strength1;
PLI_UBYTE8 strength2;
} s_strengths, *p_strengths;
typedef struct t_vc_record {
PLI_INT32 vc_reason;
PLI_INT32 vc_hightime;
PLI_INT32 vc_lowtime;
void* user_data;
union {
PLI_UBYTE8 logic_value;
double real_value;
handle vector_handle;
s_strengths strengths_s;
} out_value;
} s_vc_record, *p_vc_record;
typedef struct t_location {
PLI_INT32 line_no;
const char*filename;
} s_location, *p_location;
extern int acc_error_flag;
extern int acc_initialize(void);
extern void acc_close(void);
/*
* This is the acc_configure command, and the config_param
* codes that are accepted.
*/
extern int acc_configure(PLI_INT32 config_param, const char*value);
#define accEnableArgs 6
#define accDevelopmentVersion 11
extern int acc_fetch_argc(void);
extern char**acc_fetch_argv(void);
extern PLI_INT32 acc_fetch_direction(handle obj);
/* XXXX FIXME: Values returned by acc_fetch_direction */
# define accInout 2
extern char* acc_fetch_fullname(handle obj);
extern int acc_fetch_location(p_location loc, handle obj);
extern char* acc_fetch_name(handle obj);
extern char* acc_fetch_defname(handle obj);
extern double acc_fetch_paramval(handle obj);
extern double acc_fetch_tfarg(PLI_INT32);
extern double acc_fetch_itfarg(PLI_INT32, handle);
extern PLI_INT32 acc_fetch_tfarg_int(PLI_INT32);
extern PLI_INT32 acc_fetch_itfarg_int(PLI_INT32, handle);
extern char* acc_fetch_tfarg_str(PLI_INT32);
extern char* acc_fetch_itfarg_str(PLI_INT32, handle);
typedef struct t_timescale_info {
PLI_INT16 unit;
PLI_INT16 precision;
} s_timescale_info, *p_timescale_info;
extern void acc_fetch_timescale_info(handle obj, p_timescale_info info);
extern PLI_INT32 acc_fetch_size(handle obj);
extern PLI_INT32 acc_fetch_type(handle obj);
extern PLI_INT32 acc_fetch_fulltype(handle obj);
extern PLI_INT32 acc_fetch_range(handle object, int *msb, int *lsb);
extern char* acc_fetch_type_str(PLI_INT32 type);
extern char* acc_fetch_value(handle obj, const char*fmt, s_acc_value*value);
extern handle acc_handle_by_name(const char*name, handle scope);
extern handle acc_handle_hiconn(handle port_ref_handle);
extern handle acc_handle_object(const char*name);
extern handle acc_handle_parent(handle obj);
extern handle acc_handle_scope(handle obj);
extern handle acc_handle_simulated_net(handle net);
extern handle acc_handle_tfarg(int n);
extern handle acc_handle_tfinst(void);
extern PLI_INT32 acc_compare_handles(handle, handle);
extern handle acc_next(PLI_INT32 *, handle, handle);
extern handle acc_next_bit(handle ref, handle bit);
extern handle acc_next_port(handle ref, handle bit);
extern handle acc_next_scope(handle, handle);
extern handle acc_next_topmod(handle prev_topmod);
extern int acc_object_in_typelist(handle object, PLI_INT32*typelist);
extern int acc_object_of_type(handle object, PLI_INT32 type);
extern char*acc_product_version(void);
extern char*acc_set_scope(handle ref, ...);
extern int acc_set_value(handle obj, p_setval_value value,
p_setval_delay delay);
extern void acc_vcl_add(handle obj, PLI_INT32(*consumer)(p_vc_record),
void*data, PLI_INT32 vcl_flag);
extern void acc_vcl_delete(handle obj, PLI_INT32(*consumer)(p_vc_record),
void*data, PLI_INT32 vcl_flag);
extern char* acc_version(void);
EXTERN_C_END
/*
* $Log: acc_user.h,v $
* Revision 1.20 2003/12/17 15:45:07 steve
* Add acc_set_scope function.
*
* Revision 1.19 2003/10/10 02:57:45 steve
* Some PLI1 stubs.
*
* Revision 1.18 2003/06/13 19:23:41 steve
* Add a bunch more PLI1 routines.
*
* Revision 1.17 2003/06/04 01:56:20 steve
* 1) Adds configure logic to clean up compiler warnings
* 2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
* tf_isetrealdelay, acc_handle_scope
* 3) makes acc_next reentrant
* 4) adds basic vpiWire type support
* 5) fills in some acc_object_of_type() and acc_fetch_{full}type()
* 6) add vpiLeftRange/RigthRange to signals
*
* Revision 1.16 2003/05/30 04:18:31 steve
* Add acc_next function.
*
* Revision 1.15 2003/05/29 02:35:41 steve
* acc_fetch_type supports module.
*
* Revision 1.14 2003/05/29 02:21:45 steve
* Implement acc_fetch_defname and its infrastructure in vvp.
*
* Revision 1.13 2003/05/24 03:02:04 steve
* Add implementation of acc_handle_by_name.
*
* Revision 1.12 2003/05/18 00:16:35 steve
* Add PLI_TRACE tracing of PLI1 modules.
*
* Add tf_isetdelay and friends, and add
* callback return values for acc_vcl support.
*
* Revision 1.11 2003/04/24 18:57:05 steve
* Add acc_fetch_fulltype function.
*
* Revision 1.10 2003/04/20 02:48:39 steve
* Support value change callbacks.
*
* Revision 1.9 2003/04/12 18:57:13 steve
* More acc_ function stubs.
*
* Revision 1.8 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
* Revision 1.7 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
* Revision 1.6 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.5 2002/06/11 15:19:12 steve
* Add acc_fetch_argc/argv/version (mruff)
*
* Revision 1.4 2002/06/07 02:58:58 steve
* Add a bunch of acc/tf functions. (mruff)
*
* Revision 1.3 2002/06/02 19:03:29 steve
* Add acc_handle_tfarg and acc_next_topmode
*
* Revision 1.2 2002/05/30 02:06:05 steve
* Implement acc_product_version.
*
* Revision 1.1 2002/05/23 03:46:42 steve
* Add the acc_user.h header file.
*
*/
#endif
Vendored
+207
View File
@@ -0,0 +1,207 @@
# AX_CPP_IDENT
# ------------
# Check if the C compiler supports #ident
# Define and substitute ident_support if so.
#
# It would be simpler and more consistent with the rest of the autoconf
# structure to AC_DEFINE(HAVE_CPP_IDENT) instead of
# ident_support='-DHAVE_CVS_IDENT=1' and AC_SUBST(ident_support), but that
# change would require all C files in the icarus top level directory to
# put #include <config.h> before the #ifdef HAVE_CVS_IDENT (and change
# HAVE_CVS_IDENT to HAVE_CPP_IDENT). That would also remove all special
# ident_support handling from the Makefile. Manyana.
#
AC_DEFUN([AX_CPP_IDENT],
[AC_CACHE_CHECK([for ident support in C compiler], ax_cv_cpp_ident,
[AC_TRY_COMPILE([
#ident "$Id: aclocal.m4,v 1.7 2007/05/16 23:59:12 steve Exp $"
],[while (0) {}],
[AS_VAR_SET(ax_cv_cpp_ident, yes)],
[AS_VAR_SET(ax_cv_cpp_ident, no)])])
if test $ax_cv_cpp_ident = yes; then
ident_support='-DHAVE_CVS_IDENT=1'
fi
AC_SUBST(ident_support)
])# AC_CPP_IDENT
# _AX_C_UNDERSCORES_MATCH_IFELSE(PATTERN, ACTION-IF-MATCH, ACTION-IF-NOMATCH)
# ------------------------------
# Sub-macro for AX_C_UNDERSCORES_LEADING and AX_C_UNDERSCORES_TRAILING.
# Unwarranted assumptions:
# - the object file produced by AC_COMPILE_IFELSE is called "conftest.$ac_objext"
# - the nm(1) utility is available, and its name is "nm".
AC_DEFUN([_AX_C_UNDERSCORES_MATCH_IF],
[AC_COMPILE_IFELSE([void underscore(void){}],
[AS_IF([nm conftest.$ac_objext|grep $1 >/dev/null 2>/dev/null],[$2],[$3])],
[AC_MSG_ERROR([underscore test crashed])]
)])
# AX_C_UNDERSCORES_LEADING
# ---------------------------------
# Check if symbol names in object files produced by C compiler have
# leading underscores. Define NEED_LU if so.
AC_DEFUN([AX_C_UNDERSCORES_LEADING],
[AC_CACHE_CHECK([for leading underscores], ax_cv_c_underscores_leading,
[_AX_C_UNDERSCORES_MATCH_IF([_underscore],
[AS_VAR_SET(ax_cv_c_underscores_leading, yes)],
[AS_VAR_SET(ax_cv_c_underscores_leading, no)])])
if test $ax_cv_c_underscores_leading = yes -a "$CYGWIN" != "yes" -a "$MINGW32" != "yes"; then
AC_DEFINE([NEED_LU], [1], [Symbol names in object files produced by C compiler have leading underscores.])
fi
])# AX_C_UNDERSCORES_LEADING
# AX_C_UNDERSCORES_TRAILING
# ---------------------------------
# Check if symbol names in object files produced by C compiler have
# trailing underscores. Define NEED_TU if so.
AC_DEFUN([AX_C_UNDERSCORES_TRAILING],
[AC_CACHE_CHECK([for trailing underscores], ax_cv_c_underscores_trailing,
[_AX_C_UNDERSCORES_MATCH_IF([underscore_],
[AS_VAR_SET(ax_cv_c_underscores_trailing, yes)],
[AS_VAR_SET(ax_cv_c_underscores_trailing, no)])])
if test $ax_cv_c_underscores_trailing = yes; then
AC_DEFINE([NEED_TU], [1], [Symbol names in object files produced by C compiler have trailing underscores.])
fi
])# AX_C_UNDERSCORES_TRAILING
# AX_WIN32
# --------
# Combined check for several flavors of Microsoft Windows so
# their "issues" can be dealt with
AC_DEFUN([AX_WIN32],
[AC_CYGWIN
AC_MINGW32
WIN32=no
AC_MSG_CHECKING([for Microsoft Windows])
if test "$CYGWIN" = "yes" -o "$MINGW32" = "yes"
then
WIN32=yes
fi
AC_SUBST(MINGW32)
AC_SUBST(WIN32)
AC_MSG_RESULT($WIN32)
])# AX_WIN32
# AX_LD_EXTRALIBS
# ---------------
# mingw needs to link with libiberty.a, but cygwin alone can't tolerate it
AC_DEFUN([AX_LD_EXTRALIBS],
[AC_MSG_CHECKING([for extra libs needed])
EXTRALIBS=
case "${host}" in
*-*-cygwin* )
if test "$MINGW32" = "yes"; then
EXTRALIBS="-liberty"
fi
;;
esac
AC_SUBST(EXTRALIBS)
AC_MSG_RESULT($EXTRALIBS)
])# AX_LD_EXTRALIBS
# AX_LD_SHAREDLIB_OPTS
# --------------------
# linker options when building a shared library
AC_DEFUN([AX_LD_SHAREDLIB_OPTS],
[AC_MSG_CHECKING([for shared library link flag])
shared=-shared
case "${host}" in
*-*-cygwin*)
shared="-shared -Wl,--enable-auto-image-base"
;;
*-*-hpux*)
shared="-b"
;;
*-*-darwin1.[0123])
shared="-bundle -undefined suppress"
;;
*-*-darwin*)
shared="-bundle -undefined suppress -flat_namespace"
;;
esac
AC_SUBST(shared)
AC_MSG_RESULT($shared)
])# AX_LD_SHAREDLIB_OPTS
# AX_C_PICFLAG
# ------------
# The -fPIC flag is used to tell the compiler to make position
# independent code. It is needed when making shared objects.
AC_DEFUN([AX_C_PICFLAG],
[AC_MSG_CHECKING([for flag to make position independent code])
PICFLAG=-fPIC
case "${host}" in
*-*-cygwin*)
PICFLAG=
;;
*-*-hpux*)
PICFLAG=+z
;;
esac
AC_SUBST(PICFLAG)
AC_MSG_RESULT($PICFLAG)
])# AX_C_PICFLAG
# AX_LD_RDYNAMIC
# --------------
# The -rdynamic flag is used by iverilog when compiling the target,
# to know how to export symbols of the main program to loadable modules
# that are brought in by -ldl
AC_DEFUN([AX_LD_RDYNAMIC],
[AC_MSG_CHECKING([for -rdynamic compiler flag])
rdynamic=-rdynamic
case "${host}" in
*-*-netbsd*)
rdynamic="-Wl,--export-dynamic"
;;
*-*-openbsd*)
rdynamic="-Wl,--export-dynamic"
;;
*-*-solaris*)
rdynamic=""
;;
*-*-cygwin*)
rdynamic=""
;;
*-*-hpux*)
rdynamic="-E"
;;
*-*-darwin*)
rdynamic="-Wl,-all_load"
strip_dynamic="-SX"
;;
esac
AC_SUBST(rdynamic)
AC_MSG_RESULT($rdynamic)
AC_SUBST(strip_dynamic)
# since we didn't tell them we're "checking", no good place to tell the answer
# AC_MSG_RESULT($strip_dynamic)
])# AX_LD_RDYNAMIC
# AX_CPP_PRECOMP
# --------------
AC_DEFUN([AX_CPP_PRECOMP],
[# Darwin requires -no-cpp-precomp
case "${host}" in
*-*-darwin*)
CPPFLAGS="-no-cpp-precomp $CPPFLAGS"
CFLAGS="-no-cpp-precomp $CFLAGS"
;;
esac
])# AX_CPP_PRECOMP
+120
View File
@@ -0,0 +1,120 @@
/*
* Copyright (c) 2002 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: async.cc,v 1.7 2004/01/18 23:26:54 steve Exp $"
#endif
# include "config.h"
# include "functor.h"
# include "netlist.h"
# include <assert.h>
bool NetAssign::is_asynchronous()
{
return true;
}
bool NetCondit::is_asynchronous()
{
return false;
}
/*
* NetEvWait statements come from statements of the form @(...) in the
* Verilog source. These event waits are considered asynchronous if
* all of the events in the list are ANYEDGE, and all the inputs to
* the statement are included in the sensitivity list. If any of the
* events are posedge or negedge, the statement is synchronous
* (i.e. an edge-triggered flip-flop) and if any of the inputs are
* unaccounted for in the sensitivity list then the statement is a
* latch.
*/
bool NetEvWait::is_asynchronous()
{
/* The "sense" set contains the set of Nexa that are in the
sensitivity list. We also require that the events are all
level sensitive, but the nex_async_ method takes care of
that test. */
NexusSet*sense = new NexusSet;
for (unsigned idx = 0 ; idx < nevents_ ; idx += 1) {
NexusSet*tmp = event(idx)->nex_async_();
if (tmp == 0) {
delete sense;
return false;
}
sense->add(*tmp);
delete tmp;
}
NexusSet*inputs = statement_->nex_input();
if (! sense->contains(*inputs)) {
delete sense;
delete inputs;
return false;
}
delete sense;
delete inputs;
/* If it passes all the other tests, then this statement is
asynchronous. */
return true;
}
bool NetProc::is_asynchronous()
{
return false;
}
bool NetProcTop::is_asynchronous()
{
if (type_ == NetProcTop::KINITIAL)
return false;
return statement_->is_asynchronous();
}
/*
* $Log: async.cc,v $
* Revision 1.7 2004/01/18 23:26:54 steve
* The is_combinational function really need not recurse.
*
* Revision 1.6 2003/12/20 00:33:39 steve
* More thorough check that NetEvWait is asynchronous.
*
* Revision 1.5 2003/09/04 20:28:05 steve
* Support time0 resolution of combinational threads.
*
* Revision 1.4 2002/08/18 22:07:16 steve
* Detect temporaries in sequential block synthesis.
*
* Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.2 2002/07/04 00:24:16 steve
* initial statements are not asynchronous.
*
* Revision 1.1 2002/06/30 02:21:31 steve
* Add structure for asynchronous logic synthesis.
*
*/
+85
View File
@@ -0,0 +1,85 @@
ATTRIBUTE NAMING CONVENTIONS
Attributes that are specific to Icarus Verilog, and are intended to be
of use to programmers, start with the prefix "ivl_".
Attributes with the "_ivl_" prefix are set aside for internal
use. They may be generated internally by the compiler. They need not
be documented here.
ATTRIBUTES TO CONTROL SYNTHESIS
The following is a summary of Verilog attributes that Icarus Verilog
understands within Verilog source files to control synthesis
behavior. This section documents generic synthesis attributes. For
target specific attributes, see target specific documentation.
These attributes only effect the behavior of the synthesizer. For
example, the ivl_combinational will not generate an error message
if the Verilog is being compiled for simulation. (It may generate a
warning.)
* Attributes for "always" and "initial" statements
(* ivl_combinational *)
This attribute tells the compiler that the statement models
combinational logic. If the compiler finds that it cannot make
combinational logic out of a marked always statement, it will
report an error.
This attribute can be used to prevent accidentally inferring
latches or flip-flops where the user intended combinational
logic.
(* ivl_synthesis_on *)
This attribute tells the compiler that the marked always statement
is synthesizable. The compiler will attempt to synthesize the
code in the marked "always" statement. If it cannot in any way
synthesize it, then it will report an error.
(* ivl_synthesis_off *)
If this value is attached to an "always" statement, then the
compiler will *not* synthesize the "always" statement. This can be
used, for example, to mark embedded test bench code.
* Attributes for modules
(* ivl_synthesis_cell *)
If this value is attached to a module during synthesis, that
module will be considered a target architecture primitive, and
its interior will not be synthesized further. The module can
therefore hold a model for simulation purposes.
* Attributes for signals (wire/reg/integer/tri/etc.)
(* PAD = "<pad assignment list>" *)
If this attribute is attached to a signal that happens to be a
root module port, then targets that support it will use the string
value as a list of pin assignments for the port/signal. The format
is a comma separated list of location tokens, with the format of
the token itself defined by the back-end tools in use.
* Other Attributes
[ none defined yet ]
MISC
(* _ivl_schedule_push *)
If this attribute is attached to a thread object (always or
initial statement) then the vvp code generator will generate code
that causes the scheduler to push this thread at compile time. The
compiler may internally add this attribute to always statements if
it detects that it is combinational. This helps resolve time-0
races.
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
#
# This shell script exists to run autoconf on source distributions
# that are pulled from CVS. The configure scripts are not included
# in CVS, and there are several configure.in files, so it is easiest
# to just run this script to autoconf wherever needed.
#
echo "Autoconf in root..."
autoconf -f
for dir in vpip vpi vvp tgt-vvp tgt-fpga tgt-stub libveriuser cadpli
do
echo "Autoconf in $dir..."
( cd ./$dir ; autoconf -f --include=.. )
done
echo "Precompiling lexor_keyword.gperf"
gperf -o -i 7 -C -k 1-3,\$ -L ANSI-C -H keyword_hash -N check_identifier -t ./lexor_keyword.gperf > lexor_keyword.cc
+7
View File
@@ -0,0 +1,7 @@
Makefile
cadpli.vpl
dep
configure
config.log
config.status
autom4te.cache
+104
View File
@@ -0,0 +1,104 @@
#
# This source code is free software; you can redistribute it
# and/or modify it in source code form under the terms of the GNU
# Library General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc.,
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.13 2007/02/06 05:07:31 steve Exp $"
#
#
SHELL = /bin/sh
VERSION = 0.0
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
VPATH = $(srcdir)
bindir = @bindir@
libdir = @libdir@
includedir = $(prefix)/include
vpidir = @libdir@/ivl/@vpidir1@
CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CPPFLAGS = @ident_support@ -I$(srcdir) -I$(srcdir)/.. -I.. @CPPFLAGS@ @DEFS@ @PICFLAG@
CFLAGS = -Wall @CFLAGS@
LDFLAGS = @LDFLAGS@
SHARED = @shared@
all:
ifeq (@enable_vvp32@,yes)
vpidir32 = $(libdir)/ivl/@vpidir2@
ALL32 = all32
INSTALL32 = install32
UNINSTALL32 = uninstall32
include $(srcdir)/enable_vvp32.mk
endif
all: dep cadpli.vpl $(ALL32)
# No specific check operations.
check: all
dep:
mkdir dep
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -MD -c $<
mv $*.d dep
O = cadpli.o
SYSTEM_VPI_LDFLAGS = -L../vvp -lvpi
ifeq (@MING32@,yes)
SYSTEM_VPI_LDFLAGS += @EXTRALIBS@
endif
cadpli.vpl: $O ../vvp/libvpi.a ../libveriuser/libveriuser.o
$(CC) @shared@ -o $@ $O ../libveriuser/libveriuser.o $(SYSTEM_VPI_LDFLAGS)
clean:
rm -rf *.o dep cadpli.vpl bin32
distclean: clean
rm -f Makefile config.status config.log config.cache
install: all installdirs $(vpidir)/cadpli.vpl $(INSTALL32)
$(vpidir)/cadpli.vpl: ./cadpli.vpl
$(INSTALL_PROGRAM) ./cadpli.vpl $(vpidir)/cadpli.vpl
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(vpidir)
uninstall: $(UNINSTALL32)
rm -f $(vpidir)/cadpli.vpl
uninstall32:
ifeq (@enable_vvp32@,yes)
include $(srcdir)/enable_vvp32.mk
endif
-include $(patsubst %.o, dep/%.d, $O)
+120
View File
@@ -0,0 +1,120 @@
/*
* Copyright (c) 2003 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: cadpli.c,v 1.7 2004/09/10 00:15:45 steve Exp $"
#endif
# include <vpi_user.h>
# include <veriuser.h>
# include <stdlib.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
# include <string.h>
# include <assert.h>
# include "ivl_dlfcn.h"
typedef void* (*funcvp)(void);
static void thunker_register(void)
{
struct t_vpi_vlog_info vlog_info;
void*mod;
void*boot;
struct t_tfcell*tf;
int idx;
vpi_get_vlog_info(&vlog_info);
for (idx = 0 ; idx < vlog_info.argc ; idx += 1) {
char*module, *cp, *bp;
if (strncmp("-cadpli=", vlog_info.argv[idx], 8) != 0)
continue;
cp = vlog_info.argv[idx] + 8;
assert(cp);
bp = strchr(cp, ':');
assert(bp);
module = malloc(bp-cp+1);
strncpy(module, cp, bp-cp);
module[bp-cp] = 0;
mod = ivl_dlopen(module);
if (mod == 0) {
vpi_printf("%s link: %s\n", vlog_info.argv[idx], dlerror());
free(module);
continue;
}
bp += 1;
boot = ivl_dlsym(mod, bp);
if (boot == 0) {
vpi_printf("%s: Symbol %s not found.\n",
vlog_info.argv[idx], bp);
free(module);
continue;
}
free(module);
assert(boot);
tf = (*((funcvp)boot))();
assert(tf);
veriusertfs_register_table(tf);
}
}
void (*vlog_startup_routines[])() = {
thunker_register,
0
};
/*
* $Log: cadpli.c,v $
* Revision 1.7 2004/09/10 00:15:45 steve
* Remove bad casts.
*
* Revision 1.6 2004/09/05 21:19:51 steve
* Better type safety.
*
* Revision 1.5 2003/08/26 16:26:02 steve
* ifdef idents correctly.
*
* Revision 1.4 2003/04/30 01:28:06 steve
* Remove veriusertfs stuf.
*
* Revision 1.3 2003/02/22 04:04:38 steve
* Only include malloc.h if it is present.
*
* Revision 1.2 2003/02/17 00:01:25 steve
* Use a variant of ivl_dlfcn to do dynamic loading
* from within the cadpli module.
*
* Change the +cadpli flag to -cadpli, to keep the
* plusargs namespace clear.
*
* Revision 1.1 2003/02/16 02:23:54 steve
* Add the cadpli interface module.
*
*/
+48
View File
@@ -0,0 +1,48 @@
CADENCE PLI1 MODULES
Copyright 2003 Stephen Williams
$Id: cadpli.txt,v 1.2 2003/02/17 00:01:25 steve Exp $
With the cadpli module, Icarus Verilog is able to load PLI1
applications that were compiled and linked to be dynamic loaded by
Verilog-XL or NC-Verilog. This allows Icarus Verilog users to run
third-party modules that were compiled to interface with XL or
NC. Obviously, this only works on the operating system that the PLI
application was compiled to run on. For example, a Linux module can
only be loaded and run under Linux.
Icarus Verilog uses an interface module, the "cadpli" module, to
connect the worlds. This module is installed with Icarus Verilog, and
is invoked by the usual -m flag to iverilog or vvp. This module in
turn scans the extended arguments, looking for +cadpli= arguments. The
latter specify the share object and bootstrap function for running the
module. For example, to run the module product.so, that has the
bootstrap function "my_boot":
vvp -mcadpli a.out -cadpli=./product.so:my_boot
The "-mcadpli" argument causes vvp to load the cadpli.vpl library
module. This activates the -cadpli= argument interpreter. The
-cadpli=<module>:<boot_func> argument, then, causes vvp, through the
cadpli module, to load the loadable PLI application, invoke the
my_boot function to get a veriusertfs table, and scan that table to
register the system tasks and functions exported by that object. The
format of the -cadpli= extended argument is essentially the same as
the +loadpli1= argument to Verilog-XL.
The integration from this point is seamless. The PLI application
hardly knows that it is being invoked by Icarus Verilog instead of
Verilog-XL, so operates as it would otherwise.
$Log: cadpli.txt,v $
Revision 1.2 2003/02/17 00:01:25 steve
Use a variant of ivl_dlfcn to do dynamic loading
from within the cadpli module.
Change the +cadpli flag to -cadpli, to keep the
plusargs namespace clear.
Revision 1.1 2003/02/16 02:44:47 steve
Add the cadpli HOWTO.
+76
View File
@@ -0,0 +1,76 @@
AC_INIT(Makefile.in)
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_TOOL(STRIP, strip, true)
AC_EXEEXT
AC_SUBST(EXEEXT)
# Combined check for Microsoft-related bogosities; sets WIN32 if found
AX_WIN32
AC_PROG_INSTALL
# vvp32 is by default disabled
#enable_vvp32=no
AC_SUBST(enable_vvp32)
AC_CHECK_HEADERS(malloc.h)
AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned)
# --
# Look for a dl library to use. First look for the standard dlopen
# functions, and failing that look for the HP specific shl_load function.
AC_CHECK_HEADERS(dlfcn.h dl.h, break)
DLLIB=''
AC_CHECK_LIB(dl,dlopen,[DLLIB=-ldl])
if test -z "$DLLIB" ; then
AC_CHECK_LIB(dld,shl_load,[DLLIB=-ldld])
fi
AC_SUBST(DLLIB)
AX_CPP_PRECOMP
# Compiler option for position independent code, needed when making shared objects.
AX_C_PICFLAG
# Linker option used when compiling the target
AX_LD_RDYNAMIC
# linker options when building a shared library
AX_LD_SHAREDLIB_OPTS
AX_LD_EXTRALIBS
#######################
## test for underscores. The vpi module loader in vvm needs to know this
## in order to know the name of the start symbol for the .vpi module.
#######################
AX_C_UNDERSCORES_LEADING
AX_C_UNDERSCORES_TRAILING
#######################
## end of test for underscores
#######################
AX_CPP_IDENT
# where to put vpi subdirectories
AC_MSG_CHECKING(for VPI subdirectories)
if test x${vpidir1} = x
then
vpidir1="."
fi
AC_SUBST(vpidir1)
AC_SUBST(vpidir2)
AC_MSG_RESULT(${vpidir1} ${vpidir2})
AC_OUTPUT(Makefile)
+39
View File
@@ -0,0 +1,39 @@
#
# This source code is free software; you can redistribute it
# and/or modify it in source code form under the terms of the GNU
# Library General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc.,
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: enable_vvp32.mk,v 1.1 2003/10/09 01:07:20 steve Exp $"
#
all32: bin32 bin32/cadpli.vpl
bin32:
mkdir bin32
bin32/%.o: %.c
$(CC) -m32 -Wall -I$(srcdir) -I$(srcdir)/.. $(CPPFLAGS) $(CFLAGS) -MD -c $< -o $@
bin32/cadpli.vpl: $(addprefix bin32/,$O) ../vvp/bin32/libvpi.a ../libveriuser/bin32/libveriuser.o
$(CC) $(SHARED) -m32 -o $@ $(addprefix bin32/,$O) ../libveriuser/bin32/libveriuser.o ../vvp/bin32/libvpi.a
install32: all32 $(vpidir32)/cadpli.vpl
$(vpidir32)/cadpli.vpl: bin32/cadpli.vpl
$(INSTALL_PROGRAM) bin32/cadpli.vpl $(vpidir32)/cadpli.vpl
uninstall32:
rm -f $(vpidir32)/cadpli.vpl
+113
View File
@@ -0,0 +1,113 @@
#ifndef __ivl_dlfcn_H
#define __ivl_dlfcn_H
/*
* Copyright (c) 2001 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_dlfcn.h,v 1.3 2004/10/04 01:10:56 steve Exp $"
#endif
#if defined(__MINGW32__)
# include <windows.h>
# include <stdio.h>
typedef void * ivl_dll_t;
#elif defined(HAVE_DLFCN_H)
# include <dlfcn.h>
typedef void* ivl_dll_t;
#elif defined(HAVE_DL_H)
# include <dl.h>
typedef shl_t ivl_dll_t;
#endif
#if defined(__MINGW32__)
inline ivl_dll_t ivl_dlopen(const char *name)
{ return (void *)LoadLibrary(name); }
inline void *ivl_dlsym(ivl_dll_t dll, const char *nm)
{ return (void *)GetProcAddress((HINSTANCE)dll,nm);}
inline void ivl_dlclose(ivl_dll_t dll)
{ (void)FreeLibrary((HINSTANCE)dll);}
inline const char *dlerror(void)
{
static char msg[256];
unsigned long err = GetLastError();
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
err,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &msg,
sizeof(msg) - 1,
NULL
);
return msg;
}
#elif defined(HAVE_DLFCN_H)
inline ivl_dll_t ivl_dlopen(const char*name)
{ return dlopen(name,RTLD_LAZY); }
inline void* ivl_dlsym(ivl_dll_t dll, const char*nm)
{
void*sym = dlsym(dll, nm);
/* Not found? try without the leading _ */
if (sym == 0 && nm[0] == '_')
sym = dlsym(dll, nm+1);
return sym;
}
inline void ivl_dlclose(ivl_dll_t dll)
{ dlclose(dll); }
#elif defined(HAVE_DL_H)
inline ivl_dll_t ivl_dlopen(const char*name)
{ return shl_load(name, BIND_IMMEDIATE, 0); }
inline void* ivl_dlsym(ivl_dll_t dll, const char*nm)
{
void*sym;
int rc = shl_findsym(&dll, nm, TYPE_PROCEDURE, &sym);
return (rc == 0) ? sym : 0;
}
inline void ivl_dlclose(ivl_dll_t dll)
{ shl_unload(dll); }
inline const char*dlerror(void)
{ return strerror( errno ); }
#endif
/*
* $Log: ivl_dlfcn.h,v $
* Revision 1.3 2004/10/04 01:10:56 steve
* Clean up spurious trailing white space.
*
* Revision 1.2 2003/12/12 05:43:08 steve
* Some systems dlsym requires leading _ or not on whim.
*
* Revision 1.1 2003/02/17 00:01:25 steve
* Use a variant of ivl_dlfcn to do dynamic loading
* from within the cadpli module.
*
* Change the +cadpli flag to -cadpli, to keep the
* plusargs namespace clear.
*
*/
#endif
+4
View File
@@ -0,0 +1,4 @@
functor:cprop
functor:nodangle
-t:dll
flag:DLL=tgt-vvp/vvp.tgt
+173 -15
View File
@@ -1,7 +1,7 @@
#ifndef __compiler_H
#define __compiler_H
/*
* Copyright (c) 1999-2000 Stephen Williams ([email protected])
* Copyright (c) 1999-2004 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -18,40 +18,198 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: compiler.h,v 1.3 2000/03/17 21:50:25 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: compiler.h,v 1.33 2007/04/19 02:52:53 steve Exp $"
#endif
# include <list>
# include <map>
# include "netlist.h"
# include "StringHeap.h"
/*
* This defines constants and defaults for the compiler in general.
*/
/* The INTEGER_WIDTH is the default width of integer variables, and
the presumed width of unsigned literal numbers. */
#ifndef INTEGER_WIDTH
# define INTEGER_WIDTH 32
/* The integer_width is the width of integer variables. */
extern unsigned integer_width;
/* The TIME_WIDTH is the width of time variables. */
#ifndef TIME_WIDTH
# define TIME_WIDTH 64
#endif
/*
* When doing dynamic linking, we need a uniform way to identify the
* symbol. Some compilers put leading _, some trailing _. The
* configure script figures out which is the local convention and
* defines NEED_LU and NEED_TU as required.
*/
#ifdef NEED_LU
#define LU "_"
#else
#define LU ""
#endif
#ifdef NEED_TU
#define TU "_"
#else
#define TU ""
#endif
/*
* These are flags to enable various sorts of warnings. By default all
* the warnings are of, the -W<list> parameter arranges for each to be
* enabled.
* the warnings are off, the -W<list> parameter arranges for each to be
* enabled.
*/
/* Implicit definitions of wires. */
extern bool warn_implicit;
extern bool error_implicit;
/* inherit timescales across files. */
extern bool warn_timescale;
/* Warn about legal but questionable module port bindings. */
extern bool warn_portbinding;
/* This is true if verbose output is requested. */
extern bool verbose_flag;
extern bool debug_scopes;
extern bool debug_eval_tree;
extern bool debug_elaborate;
extern bool debug_synth2;
/* Path to a directory useful for finding subcomponents. */
extern const char*basedir;
/* This is an ordered list of library suffixes to search. */
extern list<const char*>library_suff;
extern int build_library_index(const char*path, bool key_case_sensitive);
/* This is the generation of Verilog that the compiler is asked to
support. Then there are also more detailed controls for more
specific language features. */
enum generation_t {
GN_VER1995 = 1,
GN_VER2001 = 2,
GN_VER2001X = 3,
GN_DEFAULT = 3
};
extern generation_t generation_flag;
extern bool gn_cadence_types_flag;
/* These functions test that specific features are enabled. */
inline bool gn_cadence_types_enabled()
{ return gn_cadence_types_flag && generation_flag==GN_VER2001X; }
/* If this flag is true, then elaborate specify blocks. If this flag
is false, then skip elaboration of specify behavior. */
extern bool gn_specify_blocks_flag;
/* This is the string to use to invoke the preprocessor. */
extern char*ivlpp_string;
extern map<perm_string,unsigned> missing_modules;
/* Files that are library files are in this map. The lexor compares
file names as it processes `line directives, and if the file name
matches an entry in this table, it will turn on the
library_active_flag so that modules know that they are in a
library. */
extern map<string,bool> library_file_map;
/*
* the lex_strings are perm_strings made up of tokens from the source
* file. Identifiers are so likely to be used many times that it makes
* much sense to use a StringHeapLex to hold them.
*/
extern StringHeapLex lex_strings;
extern StringHeap misc_strings;
/*
* system task/function listings.
*/
/*
* This table describes all the return values of various system
* functions. This table is used to elaborate expressions that are
* system function calls.
*/
struct sfunc_return_type {
const char* name;
ivl_variable_type_t type;
unsigned wid;
int signed_flag;
};
extern const struct sfunc_return_type* lookup_sys_func(const char*name);
extern int load_sys_func_table(const char*path);
/*
* $Log: compiler.h,v $
* Revision 1.3 2000/03/17 21:50:25 steve
* Switch to control warnings.
* Revision 1.33 2007/04/19 02:52:53 steve
* Add support for -v flag in command file.
*
* Revision 1.2 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
* Revision 1.32 2007/03/07 04:24:59 steve
* Make integer width controllable.
*
* Revision 1.1 1999/06/06 20:42:48 steve
* Make compiler width a compile time constant.
* Revision 1.31 2006/09/28 04:35:18 steve
* Support selective control of specify and xtypes features.
*
* Revision 1.30 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.29 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*
* Revision 1.28 2005/06/28 04:25:55 steve
* Remove reference to SystemVerilog.
*
* Revision 1.27 2005/04/24 23:44:01 steve
* Update DFF support to new data flow.
*
* Revision 1.26 2004/10/04 01:10:52 steve
* Clean up spurious trailing white space.
*
* Revision 1.25 2004/09/25 01:58:44 steve
* Add a debug_elaborate flag
*
* Revision 1.24 2004/09/10 23:51:42 steve
* Fix the evaluation of constant ternary expressions.
*
* Revision 1.23 2004/09/05 17:44:41 steve
* Add support for module instance arrays.
*
* Revision 1.22 2004/03/10 04:51:24 steve
* Add support for system function table files.
*
* Revision 1.21 2004/03/09 04:29:42 steve
* Separate out the lookup_sys_func table, for eventual
* support for function type tables.
*
* Remove ipal compile flags.
*
* Revision 1.20 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
* Revision 1.19 2003/11/13 05:55:33 steve
* Move the DLL= flag to target config files.
*
* Revision 1.18 2003/11/08 20:06:21 steve
* Spelling fixes in comments.
*
* Revision 1.17 2003/09/25 00:25:14 steve
* Summary list of missing modules.
*
* Revision 1.16 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
* into this table. Also, permallocate event
* names from the beginning.
*/
#endif
+776 -324
View File
File diff suppressed because it is too large Load Diff
+96
View File
@@ -0,0 +1,96 @@
#ifndef __config_H /* -*- c++ -*- */
#define __config_H
/*
* Copyright (c) 2001 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: config.h.in,v 1.12 2007/02/02 04:33:00 steve Exp $"
#endif
#if defined(__cplusplus)
# if !defined(__GNUC__)
using namespace std;
# elif (__GNUC__ == 3)
using namespace std;
# endif
#endif
# undef NEED_LU
# undef NEED_TU
# undef WLU
# undef WTU
# undef HAVE_TIMES
# undef HAVE_IOSFWD
# undef HAVE_GETOPT_H
# undef HAVE_INTTYPES_H
# undef HAVE_LIBIBERTY_H
# undef HAVE_MALLOC_H
# undef HAVE_DLFCN_H
# undef HAVE_DL_H
# undef HAVE_FCHMOD
# undef HAVE_LIBREADLINE
# undef HAVE_LIBZ
# undef HAVE_LIBBZ2
# undef HAVE_SYS_WAIT_H
# undef WORDS_BIGENDIAN
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
/*
* $Log: config.h.in,v $
* Revision 1.12 2007/02/02 04:33:00 steve
* Use inttypes.h instead of stdint.h for portability.
*
* Revision 1.11 2004/10/04 01:10:52 steve
* Clean up spurious trailing white space.
*
* Revision 1.10 2003/08/26 16:26:01 steve
* ifdef idents correctly.
*
* Revision 1.9 2003/07/03 16:29:55 steve
* spemm WORDS_BIGENDIAN correctly.
*
* Revision 1.8 2003/03/07 02:44:33 steve
* Implement $realtobits.
*
* Revision 1.7 2003/02/20 00:49:24 steve
* detect -lz and -lbz2 libraries.
*
* Revision 1.6 2003/01/10 19:01:04 steve
* Only use libiberty.h if available.
*
* Revision 1.5 2002/08/11 23:39:33 steve
* Remove VVM option.
*
* Revision 1.4 2002/02/16 03:18:53 steve
* Make vvm optional, normally off.
*
* Revision 1.3 2001/10/18 16:16:23 steve
* Include HAVE_SYS_WAIT in config.h (PR#306)
*
* Revision 1.2 2001/09/15 18:27:04 steve
* Make configure detect malloc.h
*
* Revision 1.1 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
*/
#endif // __config_H
Vendored
+484 -205
View File
File diff suppressed because it is too large Load Diff
+130 -36
View File
@@ -1,53 +1,147 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(netlist.h)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(_pli_types.h)
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_TOOL(STRIP, strip, true)
AC_CHECK_HEADERS(getopt.h)
AC_PROG_INSTALL
AC_CHECK_LIB(dl,main,[DLLIB=-ldl])
AC_CHECK_PROGS(XGPERF,gperf,none)
if test "$XGPERF" = "none"
then
echo ""
echo "*** Warning: No suitable gperf found. ***"
echo " The gperf package is essential for building ivl from"
echo " CVS sources, or modifying the parse engine of ivl itself."
echo " You can get away without it when simply building from"
echo " snapshots or major releases."
echo ""
fi
AC_CHECK_PROGS(LEX,flex,none)
if test "$LEX" = "none"
then
echo "*** Error: No suitable flex found. ***"
echo " Please install the 'flex' package."
exit 1
fi
AC_CHECK_PROGS(YACC,bison,none)
if test "$YACC" = "none"
then
echo "*** Error: No suitable bison found. ***"
echo " Please install the 'bison' package."
exit 1
fi
AC_EXEEXT
AC_SUBST(EXEEXT)
# Combined check for Microsoft-related bogosities; sets WIN32 if found
AX_WIN32
# vvp32 is by default disabled
#enable_vvp32=no
AC_SUBST(enable_vvp32)
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(getopt.h malloc.h inttypes.h libiberty.h iosfwd sys/wait.h)
AC_CHECK_LIB(z, gzwrite)
AC_CHECK_LIB(z, gzwrite, HAVE_LIBZ=yes, HAVE_LIBZ=no)
AC_SUBST(HAVE_LIBZ)
if test "$WIN32" = "yes"; then
AC_CHECK_LIB(bz2, main)
else
AC_CHECK_LIB(bz2, BZ2_bzdopen)
fi
AC_MSG_CHECKING(for sys/times)
AC_TRY_LINK(
#include <unistd.h>
#include <sys/times.h>
,{clock_t a = times(0)/sysconf(_SC_CLK_TCK);},
do_times=yes
AC_DEFINE([HAVE_TIMES], [1], [The times system call is available in the host operating system.]),
do_times=no
)
AC_MSG_RESULT($do_times)
# --
# Look for a dl library to use. First look for the standard dlopen
# functions, and failing that look for the HP specific shl_load function.
AC_CHECK_HEADERS(dlfcn.h dl.h, break)
DLLIB=''
AC_CHECK_LIB(dl,dlopen,[DLLIB=-ldl])
if test -z "$DLLIB" ; then
AC_CHECK_LIB(dld,shl_load,[DLLIB=-ldld])
fi
AC_SUBST(DLLIB)
AC_PROG_INSTALL
AC_LANG_C
AC_C_BIGENDIAN
# $host
AX_LD_EXTRALIBS
# Compiler option for position independent code, needed when making shared objects.
# CFLAGS inherited by cadpli/Makefile?
AX_C_PICFLAG
# may modify CPPFLAGS and CFLAGS
AX_CPP_PRECOMP
# Linker option used when compiling the target
AX_LD_RDYNAMIC
# linker options when building a shared library
AX_LD_SHAREDLIB_OPTS
#######################
## test for underscores
## test for underscores. The vpi module loader needs to know this
## in order to know the name of the start symbol for the .vpi module.
#######################
AC_MSG_CHECKING("for leading and/or trailing underscores")
cat << EOF > underscore.c
void underscore(void){}
EOF
$CC -c underscore.c > /dev/null 2>&1
CC_LEADING_UNDERSCORE=no
CC_TRAILING_UNDERSCORE=no
output=`nm underscore.o|grep _underscore 2>&1`
if test ! -z "$output"; then
CC_LEADING_UNDERSCORE=yes
AC_DEFINE(NEED_LU)
fi
output=`nm underscore.o|grep underscore_ 2>&1`
if test ! -z "$output"; then
CC_TRAILING_UNDERSCORE=yes
AC_DEFINE(NEED_TU)
fi
if test "$CC_LEADING_UNDERSCORE" = yes; then
AC_DEFINE(WLU)
fi
if test "$CC_TRAILING_UNDERSCORE" = yes; then
AC_DEFINE(WTU)
fi
rm underscore.c underscore.o
AC_MSG_RESULT("$CC_LEADING_UNDERSCORE $CC_TRAILING_UNDERSCORE")
AX_C_UNDERSCORES_LEADING
AX_C_UNDERSCORES_TRAILING
#######################
## end of test for underscores
#######################
AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile vvm/Makefile)
AX_CPP_IDENT
# If not otherwise specified, set the libdir64 variable
# to the same as libdir.
AC_MSG_CHECKING(for libdir64 path)
if test x${libdir64} = x
then
libdir64="${libdir}"
fi
AC_SUBST(libdir64)
AC_MSG_RESULT(${libdir64})
# where to put vpi subdirectories
AC_MSG_CHECKING(for VPI subdirectories)
if test x${vpidir1} = x
then
vpidir1="."
fi
AC_SUBST(vpidir1)
AC_SUBST(vpidir2)
AC_MSG_RESULT(${vpidir1} ${vpidir2})
# XXX disable tgt-fpga for the moment
AC_CONFIG_SUBDIRS(vvp vpi tgt-stub tgt-null tgt-vvp libveriuser cadpli)
AC_OUTPUT(Makefile ivlpp/Makefile driver/Makefile driver-vpi/Makefile tgt-null/Makefile tgt-verilog/Makefile tgt-pal/Makefile)
+886 -211
View File
File diff suppressed because it is too large Load Diff
+35
View File
@@ -0,0 +1,35 @@
This file describes the build procedure under cygwin32 (Windows 95/98/NT/2K)
----------------------------------------------------------------------------
Note: Icarus Verilog also compiles to native Windows binaries if you
use the instructions in the mingw.txt file. Some people prefer cygwin
binaries, and these instructions apply.
To build using cygwin:
Prerequisites:
o Latest net release (1.1.4) of cygwin (sources.redhat.com/cygwin)
Procedure:
o Get the source code - see the main Icarus Verilog page for how to
do this
o cd to the verilog directory
o autoconf.sh
o ./configure
o make
o make install
That's all that's needed.
To build your own extensions - just include vpi_user.h and link with
a command like this:
$(CC) -shared -o <dllname> <objects> -Wl,--enable-auto-image-base -L../vvm -lvvm -lvpip
- Venkat Iyer <[email protected]>
+947 -319
View File
File diff suppressed because it is too large Load Diff
+88
View File
@@ -0,0 +1,88 @@
/*
* Copyright (c) 2001 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: dosify.c,v 1.5 2003/07/15 16:17:47 steve Exp $"
#endif
/*
* This is a simple program to make a dosified copy of the
* original. That is, it converts unix style line ends to DOS
* style. This is useful for installing text files.
*
* The exact substitution is to replace \n with \r\n. If the line
* already ends with \r\n then it is not changed to \r\r\n.
*/
# include <stdio.h>
int main(int argc, char*argv[])
{
FILE*ifile;
FILE*ofile;
int ch, pr;
if (argc != 3) {
fprintf(stderr, "Usage: %s <input> <output>\n", argv[0]);
return 1;
}
ifile = fopen(argv[1], "rb");
if (ifile == 0) {
fprintf(stderr, "Unable to open %s for input.\n", argv[1]);
return 2;
}
ofile = fopen(argv[2], "wb");
if (ofile == 0) {
fprintf(stderr, "Unable to open %s for output.\n", argv[2]);
return 2;
}
pr = 0;
while ((ch = fgetc(ifile)) != EOF) {
if ((ch == '\n') && (pr != '\r'))
fputc('\r', ofile);
fputc(ch, ofile);
pr = ch;
}
return 0;
}
/*
* $Log: dosify.c,v $
* Revision 1.5 2003/07/15 16:17:47 steve
* Fix spelling of ifdef.
*
* Revision 1.4 2003/07/15 03:49:22 steve
* Spelling fixes.
*
* Revision 1.3 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.2 2002/08/11 23:47:04 steve
* Add missing Log and Ident strings.
*
* Revision 1.1 2001/08/03 17:06:47 steve
* Add install of examples for Windows.
*
*/
+2
View File
@@ -0,0 +1,2 @@
Makefile
iverilog-vpi.exe
+80
View File
@@ -0,0 +1,80 @@
#
# This source code is free software; you can redistribute it
# and/or modify it in source code form under the terms of the GNU
# Library General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc.,
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.7 2004/10/13 22:01:34 steve Exp $"
#
#
SHELL = /bin/sh
VERSION = 0.8
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
VPATH = $(srcdir)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
mandir = @mandir@
dllib=@DLLIB@
CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CPPFLAGS = @ident_support@ -I. -I$(srcdir)/.. -DVERSION='"$(VERSION)"' @CPPFLAGS@ @DEFS@
CFLAGS = -Wall @CFLAGS@
LDFLAGS = @LDFLAGS@
all: iverilog-vpi@EXEEXT@
clean:
rm -f *.o
rm -f iverilog-vpi@EXEEXT@
distclean: clean
rm -f Makefile
O = main.o res.o
iverilog-vpi@EXEEXT@: $O
$(CC) $(LDFLAGS) $O -o iverilog-vpi@EXEEXT@ @EXTRALIBS@
main.o: main.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/main.c
# Windows specific...
res.o: res.rc
windres -i res.rc -o res.o
#
install: all installdirs $(bindir)/iverilog-vpi@EXEEXT@
$(bindir)/iverilog-vpi@EXEEXT@: ./iverilog-vpi@EXEEXT@
$(INSTALL_PROGRAM) ./iverilog-vpi@EXEEXT@ $(bindir)/iverilog-vpi@EXEEXT@
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(bindir)
uninstall:
rm -f $(bindir)/iverilog-vpi@EXEEXT@
+573
View File
@@ -0,0 +1,573 @@
/*
* Copyright (c) 2002 Gus Baldauf (gus@picturel.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*
* iverilog-vpi.c
*
* this program provides the functionality of iverilog-vpi.sh under Win32
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <windows.h>
/* Macros used for compiling and linking */
#define IVERILOG_VPI_CC "gcc" /* no .exe extension */
#define IVERILOG_VPI_CXX "gcc" /* no .exe extension */
#define IVERILOG_VPI_CFLAGS "-O" /* -I appended later */
#define IVERILOG_VPI_LD "gcc" /* no .exe extension */
#define IVERILOG_VPI_LDFLAGS "-shared -Wl,--enable-auto-image-base"
#define IVERILOG_VPI_LDLIBS "-lveriuser -lvpi" /* -L prepended later */
/* pointers to global strings */
static struct global_strings {
char *pCCSRC; /* list of C source files */
char *pCXSRC; /* list of C++ source files */
char *pOBJ; /* list of object files */
char *pLIB; /* list of library files */
char *pOUT; /* output file name (.vpi extension), if 0 length then no source files specified */
char *pMINGW; /* path to MinGW directory */
char *pIVL; /* path to IVL directory */
char *pCFLAGS; /* CFLAGS option */
char *pLDLIBS; /* LDLIBS option */
char *pNewPath; /* new PATH environment variable setting */
} gstr;
static void deInitDynString(char *str)
{
free(str);
}
/* when finished, free allocated memory and return error code */
static void myExit(int exitVal)
{
deInitDynString(gstr.pCCSRC);
deInitDynString(gstr.pCXSRC);
deInitDynString(gstr.pOBJ);
deInitDynString(gstr.pLIB);
deInitDynString(gstr.pOUT);
deInitDynString(gstr.pMINGW);
deInitDynString(gstr.pIVL);
deInitDynString(gstr.pCFLAGS);
deInitDynString(gstr.pLDLIBS);
deInitDynString(gstr.pNewPath);
exit(exitVal);
}
/* display usage summary and exit */
static void usage()
{
fprintf(stderr,"usage: iverilog-vpi [--name=name] [-llibrary] [-mingw=dir] [-ivl=dir] sourcefile...\n");
fprintf(stderr," or iverilog-vpi -mingw=dir\n");
fprintf(stderr," or iverilog-vpi -ivl=dir\n");
myExit(1);
}
static void initDynString(char **str)
{
*str = (char *) malloc(1);
if (!*str) {
fprintf(stderr,"error: out of memory\n");
myExit(4);
}
*str[0] = 0;
}
/* initialize dynamic memory buffers */
static void init()
{
initDynString(&gstr.pCCSRC);
initDynString(&gstr.pCXSRC);
initDynString(&gstr.pOBJ);
initDynString(&gstr.pLIB);
initDynString(&gstr.pOUT);
initDynString(&gstr.pMINGW);
initDynString(&gstr.pIVL);
initDynString(&gstr.pCFLAGS);
initDynString(&gstr.pLDLIBS);
initDynString(&gstr.pNewPath);
}
/* return true if "str" is terminated with with "end", case insensitive */
static int endsIn (char *end, char *str)
{
char *ext;
if (strlen(end) >= strlen(str))
return 0;
ext = str + (strlen(str) - strlen(end));
return stricmp(end,ext) ? 0 : 1;
}
/* return true if "str" begins with "prefix", case insensitive */
static int startsWith (char *prefix, char *str)
{
if (strlen(prefix) >= strlen(str))
return 0;
return strnicmp(prefix,str,strlen(prefix)) ? 0 : 1;
}
/* append "app" to "ptr", allocating memory as needed */
/* if count is zero, then copy all characters of "app" */
static void appendn (char **ptr, char *app, int count)
{
*ptr = (char *) realloc(*ptr,strlen(*ptr)+(count?count:strlen(app))+1);
if (*ptr == NULL) {
fprintf(stderr,"error: out of memory\n");
myExit(4);
}
if (count)
strncat(*ptr,app,count);
else
strcat(*ptr,app);
}
/* append "app" to "ptr", allocating memory as needed */
static void append (char **ptr, char *app)
{
appendn(ptr,app,0);
}
/* if the string does not end with a backslash, add one */
static void appendBackSlash(char **str)
{
if ((*str)[strlen(*str)-1] != '\\')
append(str,"\\");
}
/* copy count characters of "str" to "ptr", allocating memory as needed */
/* if count is zero, then copy all characters of "str" */
static void assignn (char **ptr, char *str, int count)
{
*ptr = (char *) realloc(*ptr,(count?count:strlen(str))+1);
if (*ptr == NULL) {
fprintf(stderr,"error: out of memory\n");
myExit(4);
}
if (count) {
strncpy(*ptr,str,count);
(*ptr)[count] = 0;
}
else
strcpy(*ptr,str);
}
/* copy count characters of "str" to "ptr", allocating memory as needed */
static void assign (char **ptr, char *str)
{
assignn(ptr,str,0);
}
/* get a copy of a Icarus Verilog registry string key */
static int GetRegistryKey(char *key, char **value)
{
long lrv;
HKEY hkKey;
char *regKeyBuffer;
DWORD regKeyType, regKeySize;
lrv = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Icarus Verilog",0,KEY_QUERY_VALUE,&hkKey);
if (lrv != ERROR_SUCCESS)
return 0;
lrv = RegQueryValueEx(hkKey,key,NULL,&regKeyType,NULL,&regKeySize);
if ((lrv != ERROR_SUCCESS) || (regKeyType != REG_SZ) || (!regKeySize)) {
lrv = RegCloseKey(hkKey);
return 0;
}
regKeyBuffer = (char *) malloc(regKeySize+1);
if (!regKeyBuffer) {
lrv = RegCloseKey(hkKey);
fprintf(stderr,"error: out of memory\n");
myExit(4);
}
regKeyBuffer[regKeySize] = 0; /* makes sure there is a trailing NULL */
lrv = RegQueryValueEx(hkKey,key,NULL,&regKeyType,regKeyBuffer,&regKeySize);
if ((lrv != ERROR_SUCCESS) || (regKeyType != REG_SZ) || (!regKeySize)) {
lrv = RegCloseKey(hkKey);
free(regKeyBuffer);
return 0;
}
RegCloseKey(hkKey);
assign(value,regKeyBuffer);
free(regKeyBuffer);
return 1;
}
/* store a copy of a Icarus Verilog registry string key */
static void SetRegistryKey(char *key, char *value)
{
HKEY hkKey;
DWORD res;
if (RegCreateKeyEx(
HKEY_LOCAL_MACHINE,
"Software\\Icarus Verilog",
0,
"",
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,NULL,
&hkKey,
&res) != ERROR_SUCCESS)
return;
RegSetValueEx(hkKey,key,0,REG_SZ,value,strlen(value)+1);
RegCloseKey(hkKey);
printf("info: storing %s in Windows' registry entry\n",value);
printf(" HKEY_LOCAL_MACHINE\\Software\\Icarus Verilog\\%s\n",key);
}
/* parse the command line, assign results to global variable strings */
static int parse(int argc, char *argv[])
{
int idx, srcFileCnt=0;
char dot_c_ext[] = ".c";
char dot_cc_ext[] = ".cc";
char dot_cpp_ext[] = ".cpp";
char dot_o_ext[] = ".o";
char name_option[] = "--name=";
char lib_option[] = "-l";
char mingw_option[] = "-mingw=";
char ivl_option[] = "-ivl=";
if (argc == 1)
return 0;
for (idx=1; idx<argc; ++idx) {
if (endsIn(dot_c_ext,argv[idx])) { /* check for C source files */
++srcFileCnt;
append(&gstr.pCCSRC,argv[idx]);
append(&gstr.pCCSRC," ");
if (!*gstr.pOUT)
assignn(&gstr.pOUT,argv[idx],strlen(argv[idx])-strlen(dot_c_ext));
}
else if (endsIn(dot_cc_ext,argv[idx])) { /* check for C++ source files */
++srcFileCnt;
append(&gstr.pCXSRC,argv[idx]);
append(&gstr.pCXSRC," ");
if (!*gstr.pOUT)
assignn(&gstr.pOUT,argv[idx],strlen(argv[idx])-strlen(dot_cc_ext));
}
else if (endsIn(dot_cpp_ext,argv[idx])) { /* check for C++ source files */
++srcFileCnt;
append(&gstr.pCXSRC,argv[idx]);
append(&gstr.pCXSRC," ");
if (!*gstr.pOUT)
assignn(&gstr.pOUT,argv[idx],strlen(argv[idx])-strlen(dot_cpp_ext));
}
else if (endsIn(dot_o_ext,argv[idx])) { /* check for compiled object files */
++srcFileCnt;
append(&gstr.pOBJ,argv[idx]);
append(&gstr.pOBJ," ");
if (!*gstr.pOUT)
assignn(&gstr.pOUT,argv[idx],strlen(argv[idx])-strlen(dot_o_ext));
}
else if (startsWith(name_option,argv[idx])) { /* check for --name option */
assignn(&gstr.pOUT,argv[idx]+sizeof(name_option)-1,strlen(argv[idx])-(sizeof(name_option)-1));
}
else if (startsWith(lib_option,argv[idx])) { /* check for -l option */
append(&gstr.pLIB,argv[idx]);
append(&gstr.pLIB," ");
}
else if (startsWith(mingw_option,argv[idx])) /* check for -mingw option */
assignn(&gstr.pMINGW,argv[idx]+sizeof(mingw_option)-1,strlen(argv[idx])-(sizeof(mingw_option)-1));
else if (startsWith(ivl_option,argv[idx])) /* check for -ivl option */
assignn(&gstr.pIVL,argv[idx]+sizeof(ivl_option)-1,strlen(argv[idx])-(sizeof(ivl_option)-1));
else
return 0; /* different from iverilog-vpi.sh, we don't ignore accept arguments */
}
if (0 == srcFileCnt)
assign(&gstr.pOUT,""); /* in case they used --name with no source files */
if (!*gstr.pOUT) { /* normally it's an error if there are no *.c,*.cc,*.o files */
if (!*gstr.pMINGW && !*gstr.pIVL) /* unless they are just setting the IVL or MinGW registry entries */
usage();
}
else {
append(&gstr.pOUT,".vpi"); /* the result file should have a .vpi extension */
append(&gstr.pOUT," ");
}
return 1;
}
/* do minimal check that the MinGW root directory looks valid */
static void checkMingwDir(char *root)
{
int irv;
struct _stat stat_buf;
char *path;
initDynString(&path);
assign(&path,gstr.pMINGW);
appendBackSlash(&path);
append(&path,"bin\\" IVERILOG_VPI_CC ".exe");
irv = _stat(path,&stat_buf);
deInitDynString(path);
if (irv) {
fprintf(stderr,"error: %s does not appear to be the valid root directory\n",root);
fprintf(stderr," of MinGW. Use the -mingw option of iverilog-vpi.exe to\n");
fprintf(stderr," point to the MinGW root directory. For a Windows command\n");
fprintf(stderr," shell the option would be something like -mingw=c:\\mingw\n");
fprintf(stderr," For a Cygwin shell the option would be something like\n");
fprintf(stderr," -mingw=c:\\\\mingw\n");
myExit(5);
}
}
/* do minimal check that the Icarus Verilog root directory looks valid */
static void checkIvlDir(char *root)
{
int irv;
struct _stat stat_buf;
char *path;
initDynString(&path);
assign(&path,gstr.pIVL);
appendBackSlash(&path);
append(&path,"bin\\vvp.exe");
irv = _stat(path,&stat_buf);
deInitDynString(path);
if (irv) {
fprintf(stderr,"error: %s does not appear to be the valid root directory of\n",root);
fprintf(stderr," Icarus Verilog. Use the -ivl option of iverilog-vpi.exe to\n");
fprintf(stderr," point to the Icarus Verilog root directory. For a Windows\n");
fprintf(stderr," command shell the option would be something like -ivl=c:\\iverilog\n");
fprintf(stderr," For a Cygwin shell the option would be something like\n");
fprintf(stderr," -ivl=c:\\\\iverilog\n");
myExit(6);
}
}
/* see if we can find mingw root */
#define IVL_REGKEY_MINGW "MingwDir"
static void setup_mingw_environment()
{
char *pOldPATH = getenv("PATH"); /* get current path */
if (*gstr.pMINGW) {
checkMingwDir(gstr.pMINGW);
SetRegistryKey(IVL_REGKEY_MINGW,gstr.pMINGW);
}
else
if (!GetRegistryKey(IVL_REGKEY_MINGW,&gstr.pMINGW)) {
fprintf(stderr,"error: can not locate the MinGW root directory, use the -mingw option of\n");
fprintf(stderr," iverilog-vpi.exe to point to the MinGW root directory. For\n");
fprintf(stderr," a Windows command shell the option would be something like\n");
fprintf(stderr," -mingw=c:\\mingw For a Cygwin shell the option would be\n");
fprintf(stderr," something like -mingw=c:\\\\mingw\n");
myExit(5);
}
assign(&gstr.pNewPath,"PATH="); /* create new path */
append(&gstr.pNewPath,gstr.pMINGW);
appendBackSlash(&gstr.pNewPath);
append(&gstr.pNewPath,"bin;");
append(&gstr.pNewPath,pOldPATH);
_putenv(gstr.pNewPath); /* place new path in environment variable */
}
/* see if we can find iverilog root */
#define IVL_REGKEY_IVL "InstallDir"
static void setup_ivl_environment()
{
if (*gstr.pIVL) {
checkIvlDir(gstr.pIVL);
SetRegistryKey(IVL_REGKEY_IVL,gstr.pIVL);
}
else
if (!GetRegistryKey(IVL_REGKEY_IVL,&gstr.pIVL)) {
fprintf(stderr,"error: can not locate the Icarus Verilog root directory, use the -ivl option\n");
fprintf(stderr," of iverilog-vpi.exe to point to the Icarus Verilog root directory.\n");
fprintf(stderr," For a Windows command shell the option would be something like\n");
fprintf(stderr," -ivl=c:\\iverilog For a Cygwin shell the option would be something\n");
fprintf(stderr," like -ivl=c:\\\\iverilog\n");
myExit(6);
}
/* build up the CFLAGS option string */
assign(&gstr.pCFLAGS,IVERILOG_VPI_CFLAGS);
append(&gstr.pCFLAGS," -I");
append(&gstr.pCFLAGS,gstr.pIVL);
appendBackSlash(&gstr.pCFLAGS);
append(&gstr.pCFLAGS,"include");
/* build up the LDFLAGS option string */
assign(&gstr.pLDLIBS,"-L");
append(&gstr.pLDLIBS,gstr.pIVL);
appendBackSlash(&gstr.pLDLIBS);
append(&gstr.pLDLIBS,"lib ");
append(&gstr.pLDLIBS,IVERILOG_VPI_LDLIBS);
}
/* compile source modules */
static void compile(char *pSource, char **pObject, char *ext, int *compile_errors, char *compiler)
{
char *ptr1 = pSource;
char *ptr2 = strchr(pSource,' ');
char *buf=0,*src=0,*obj=0;
while (ptr2) {
int len = ptr2 - ptr1;
assignn(&src,ptr1,len);
assignn(&obj,ptr1,len-strlen(ext)); /* strip off the extension */
append (&obj,".o");
assign (&buf,compiler);
append (&buf," -c -o ");
append (&buf,obj);
append (&buf," ");
append (&buf,gstr.pCFLAGS);
append (&buf," ");
append (&buf,src);
append (pObject,obj);
append (pObject," ");
printf("%s\n",buf);
if (system(buf))
++*compile_errors;
ptr1 = ptr2 + 1; /* advance to next token */
ptr2 = strchr(ptr1,' ');
}
free(buf);
free(src);
free(obj);
}
/* using the global strings, compile and link */
static void compile_and_link()
{
char *buf=0;
int iRet, compile_errors = 0;
/* print out the mingw and ivl directories to help the user debug problems */
printf("info: %s will be used as the MinGW root directory.\n",gstr.pMINGW);
checkMingwDir(gstr.pMINGW);
printf("info: %s will be used as the Icarus Verilog root directory.\n",gstr.pIVL);
checkIvlDir(gstr.pIVL);
/* compile */
compile(gstr.pCCSRC,&gstr.pOBJ,".c" ,&compile_errors,IVERILOG_VPI_CC ); /* compile the C source files */
compile(gstr.pCXSRC,&gstr.pOBJ,".cc",&compile_errors,IVERILOG_VPI_CXX); /* compile the C++ source files */
if (compile_errors) {
fprintf(stderr,"iverilog-vpi: Some %d files failed to compile.\n",compile_errors);
myExit(2);
}
/* link */
assign(&buf,IVERILOG_VPI_LD);
append(&buf," -o ");
append(&buf,gstr.pOUT); /* has a trailing space */
append(&buf,IVERILOG_VPI_LDFLAGS);
append(&buf," ");
append(&buf,gstr.pOBJ) /* has a trailing space */;
append(&buf,gstr.pLIB); /* has a trailing space */
append(&buf,gstr.pLDLIBS);
printf("%s\n",buf);
iRet = system(buf);
free(buf);
if (iRet)
myExit(3);
}
/* program execution starts here */
int main(int argc, char *argv[])
{
init();
if (!parse(argc,argv))
usage();
setup_mingw_environment();
setup_ivl_environment();
if (*gstr.pOUT) /* are there any *.c,*.cc,*.o files specified */
compile_and_link();
myExit(0);
}
+38
View File
@@ -0,0 +1,38 @@
// LANGUAGE ENGLISH
LANGUAGE 9, 4
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
1 VERSIONINFO
FILEVERSION 2002,11,13,0
PRODUCTVERSION 0,7,0,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x2L
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Icarus Verilog\0"
VALUE "FileDescription", "Icarus Verilog VPI Tool\0"
VALUE "FileVersion", "2002, 11, 13, 0\0"
VALUE "InternalName", "iverilog-vpi\0"
VALUE "LegalCopyright", "Copyright 2002 Gus Baldauf\0"
VALUE "OriginalFilename", "iverilog-vpi.exe\0"
VALUE "ProductName", "Icarus Verilog\0"
VALUE "ProductVersion", "0, 7, 0, 0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
+15
View File
@@ -0,0 +1,15 @@
a.out
Makefile
parse.c
parse.h
parse.output
lexor.c
cfparse.c
cfparse.h
cfparse.output
cflexor.c
foo.*
iverilog
iverilog.ps
iverilog.pdf
tmp.pdf
+108
View File
@@ -0,0 +1,108 @@
#
# This source code is free software; you can redistribute it
# and/or modify it in source code form under the terms of the GNU
# Library General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc.,
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.26 2007/02/06 05:07:31 steve Exp $"
#
#
SHELL = /bin/sh
VERSION = 0.8
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
VPATH = $(srcdir)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
mandir = @mandir@
dllib=@DLLIB@
CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CPPFLAGS = @ident_support@ -I. -I.. -I$(srcdir)/.. -I$(srcdir) -DVERSION='"$(VERSION)"' @CPPFLAGS@ @DEFS@
CFLAGS = -Wall @CFLAGS@
LDFLAGS = @LDFLAGS@
all: iverilog@EXEEXT@
clean:
rm -f *.o lexor.c parse.c parse.h parse.output
rm -f cflexor.c cfparse.c cfparse.h cfparse.output
rm -f iverilog@EXEEXT@ iverilog.pdf iverilog.ps
distclean: clean
rm -f Makefile
O = main.o substit.o cflexor.o cfparse.o
iverilog@EXEEXT@: $O
$(CC) $(LDFLAGS) $O -o iverilog@EXEEXT@ @EXTRALIBS@
cflexor.c: cflexor.lex
flex -s -Pcf -ocflexor.c $(srcdir)/cflexor.lex
cfparse.h cfparse.c: cfparse.y
bison --verbose -t -d -o cfparse.c --name-prefix=cf $(srcdir)/cfparse.y
main.o: main.c globals.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -DIVL_ROOT='"@libdir@/ivl"' -DIVL_INC='"@includedir@"' -DIVL_LIB='"@libdir@"' -DDLLIB='"@DLLIB@"' $(srcdir)/main.c
build_string.o: build_string.c globals.h
cflexor.o: cflexor.c cfparse.h cfparse_misc.h globals.h
cfparse.o: cfparse.c globals.h cfparse_misc.h
iverilog.ps: $(srcdir)/iverilog.man
man -t $(srcdir)/iverilog.man > iverilog.ps
iverilog.pdf: iverilog.ps
ps2pdf iverilog.ps iverilog.pdf
ifeq (@MING32@,yes)
INSTALL_DOC = $(prefix)/iverilog.pdf $(mandir)/man1/iverilog.1
INSTALL_DOCDIR = $(mandir)/man1
all: iverilog.pdf
else
INSTALL_DOC = $(mandir)/man1/iverilog.1
INSTALL_DOCDIR = $(mandir)/man1
endif
install: all installdirs $(bindir)/iverilog@EXEEXT@ $(INSTALL_DOC)
$(bindir)/iverilog@EXEEXT@: ./iverilog@EXEEXT@
$(INSTALL_PROGRAM) ./iverilog@EXEEXT@ $(bindir)/iverilog@EXEEXT@
$(mandir)/man1/iverilog.1: $(srcdir)/iverilog.man
$(INSTALL_DATA) $(srcdir)/iverilog.man $(mandir)/man1/iverilog.1
$(prefix)/iverilog.pdf: iverilog.pdf
$(INSTALL_DATA) iverilog.pdf $(prefix)/iverilog.pdf
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(bindir) $(INSTALL_DOCDIR)
uninstall:
rm -f $(bindir)/iverilog@EXEEXT@
rm -f $(mandir)/man1/iverilog.1 $(prefix)/iverilog.pdf
+173
View File
@@ -0,0 +1,173 @@
%{
/*
* Copyright (c) 2001 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: cflexor.lex,v 1.11 2007/03/22 16:08:18 steve Exp $"
#endif
# include "cfparse.h"
# include "cfparse_misc.h"
# include "globals.h"
# include <string.h>
/*
* Lexical location information is passed in the yylloc variable to th
* parser. The file names, strings, are kept in a list so that I can
* re-use them. The set_file_name function will return a pointer to
* the name as it exists in the list (and delete the passed string.)
* If the name is new, it will be added to the list.
*/
YYLTYPE yylloc;
static int comment_enter;
static char* trim_trailing_white(char*txt, int trim);
%}
%x CCOMMENT
%x LCOMMENT
%x PLUS_ARGS
%x FILE_NAME
%%
/* Accept C++ style comments. */
"//".* { comment_enter = YY_START; BEGIN(LCOMMENT); }
<LCOMMENT>. { yymore(); }
<LCOMMENT>\n { yylloc.first_line += 1; BEGIN(comment_enter); }
/* Accept C style comments. */
"/*" { comment_enter = YY_START; BEGIN(CCOMMENT); }
<CCOMMENT>. { yymore(); }
<CCOMMENT>\n { yylloc.first_line += 1; yymore(); }
<CCOMMENT>"*/" { BEGIN(comment_enter); }
/* Accept shell type comments. */
^"#".* { ; }
/* Skip white space. */
[ \t\f\r] { ; }
/* Skip line ends, but also count the line. */
\n { yylloc.first_line += 1; }
"+define+" { BEGIN(PLUS_ARGS); return TOK_DEFINE; }
"+incdir+" { BEGIN(PLUS_ARGS); return TOK_INCDIR; }
"+libdir+" { BEGIN(PLUS_ARGS); return TOK_LIBDIR; }
"+libdir-nocase+" { BEGIN(PLUS_ARGS); return TOK_LIBDIR_NOCASE; }
"+libext+" { BEGIN(PLUS_ARGS); return TOK_LIBEXT; }
"+integer-width+" { BEGIN(PLUS_ARGS); return TOK_INTEGER_WIDTH; }
/* If it is not any known plus-flag, return the generic form. */
"+"[^\n \t\b\f\r+]* {
cflval.text = strdup(yytext);
BEGIN(PLUS_ARGS);
return TOK_PLUSWORD; }
/* Once in PLUS_ARGS mode, words are delimited by +
characters. White space and line end terminate PLUS_ARGS mode,
but + terminates only the word. */
<PLUS_ARGS>[^\n \t\b\f\r+]* {
cflval.text = strdup(yytext);
return TOK_PLUSARG; }
/* Within plusargs, this is a delimiter. */
<PLUS_ARGS>"+" { }
/* White space end plus_args mode. */
<PLUS_ARGS>[ \t\b\f\r] { BEGIN(0); }
<PLUS_ARGS>\n {
yylloc.first_line += 1;
BEGIN(0); }
/* Notice the -a flag. */
"-a" { return TOK_Da; }
/* Notice the -v flag. */
"-v" { return TOK_Dv; }
/* Notice the -y flag. */
"-y" { return TOK_Dy; }
/* This rule matches paths and strings that may be file names. This
is a little bit tricky, as we don't want to mistake a comment for
a string word. */
"/"[\r\n] { /* Special case of file name "/" */
cflval.text = trim_trailing_white(yytext, 0);
return TOK_STRING; }
"/"[^\*\/] { /* A file name that starts with "/". */
yymore();
BEGIN(FILE_NAME); }
[^/\n \t\b\r+-][^/\n\r]* { /* A file name that starts with other than "/" */
yymore();
BEGIN(FILE_NAME); }
<FILE_NAME>"//" {
/* Found a trailing comment. Returning the terminated name. */
cflval.text = trim_trailing_white(yytext, 2);
BEGIN(LCOMMENT);
return TOK_STRING; }
<FILE_NAME>"/"?[^/\n\r]* {
yymore();
/* not a comment... continuing */; }
<FILE_NAME>[\n\r] {
/* No trailing comment. Return the file name. */
cflval.text = trim_trailing_white(yytext, 0);
BEGIN(0);
return TOK_STRING; }
/* Fallback match. */
. { return yytext[0]; }
%%
static char* trim_trailing_white(char*text, int trim)
{
char*cp = text + strlen(text);
while (cp > text && trim > 0) {
trim -= 1;
cp -= 1;
*cp = 0;
}
while (cp > text && strchr("\n\r\t\b", cp[-1]))
cp -= 1;
cp[0] = 0;
return strdup(text);
}
int yywrap()
{
return 1;
}
void cfreset(FILE*fd, const char*path)
{
yyin = fd;
yyrestart(fd);
yylloc.first_line = 1;
yylloc.text = (char*)path;
}
+222
View File
@@ -0,0 +1,222 @@
%{
/*
* Copyright (c) 20001 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: cfparse.y,v 1.12 2007/04/19 02:52:53 steve Exp $"
#endif
# include "globals.h"
# include "cfparse_misc.h"
# include <ctype.h>
# include <stdlib.h>
# include <string.h>
/*
* This flag is set to 0, 1 or 2 if file names are to be translated to
* uppercase(1) or lowercase(2).
*/
static int setcase_filename_flag = 0;
static void translate_file_name(char*text)
{
switch (setcase_filename_flag) {
case 0:
break;
case 1:
while (*text) {
*text = toupper(*text);
text += 1;
}
break;
case 2:
while (*text) {
*text = tolower(*text);
text += 1;
}
break;
}
}
%}
%union {
char*text;
};
%token TOK_Da TOK_Dv TOK_Dy
%token TOK_DEFINE TOK_INCDIR TOK_LIBDIR TOK_LIBDIR_NOCASE TOK_LIBEXT
%token TOK_INTEGER_WIDTH
%token <text> TOK_PLUSARG TOK_PLUSWORD TOK_STRING
%%
start
:
| item_list
;
item_list
: item_list item
| item
;
item
/* Absent any other matching, a token string is taken to be the name
of a source file. Add the file to the file list. */
: TOK_STRING
{ char*tmp = substitutions($1);
translate_file_name(tmp);
process_file_name(tmp, 0);
free($1);
free(tmp);
}
/* The -a flag is completely ignored. */
| TOK_Da { }
/* The -v <libfile> flag is ignored, and the <libfile> is processed
as an ordinary source file. */
| TOK_Dv TOK_STRING
{ char*tmp = substitutions($2);
translate_file_name(tmp);
process_file_name(tmp, 1);
free($2);
free(tmp);
}
/* This rule matches "-y <path>" sequences. This does the same thing
as -y on the command line, so add the path to the library
directory list. */
| TOK_Dy TOK_STRING
{ char*tmp = substitutions($2);
process_library_switch(tmp);
free($2);
free(tmp);
}
| TOK_LIBDIR TOK_PLUSARG
{ char*tmp = substitutions($2);
process_library_switch(tmp);
free($2);
free(tmp);
}
| TOK_LIBDIR_NOCASE TOK_PLUSARG
{ char*tmp = substitutions($2);
process_library_nocase_switch(tmp);
free($2);
free(tmp);
}
| TOK_DEFINE TOK_PLUSARG
{ process_define($2);
free($2);
}
/* The +incdir token introduces a list of +<path> arguments that are
the include directories to search. */
| TOK_INCDIR inc_args
/* The +libext token introduces a list of +<ext> arguments that
become individual -Y flags to ivl. */
| TOK_LIBEXT libext_args
/* These are various misc flags that are supported. */
| TOK_INTEGER_WIDTH TOK_PLUSARG
{ char*tmp = substitutions($2);
free($2);
integer_width = strtoul(tmp,0,10);
free(tmp);
}
/* The +<word> tokens that are not otherwise matched, are
ignored. The skip_args rule arranges for all the argument words
to be consumed. */
| TOK_PLUSWORD skip_args
{ fprintf(stderr, "%s:%u: Ignoring %s\n",
@1.text, @1.first_line, $1);
free($1);
}
| TOK_PLUSWORD
{ if (strcmp($1, "+toupper-filenames") == 0) {
setcase_filename_flag = 1;
} else if (strcmp($1, "+tolower-filenames") == 0) {
setcase_filename_flag = 2;
} else {
fprintf(stderr, "%s:%u: Ignoring %s\n",
@1.text, @1.first_line, $1);
}
free($1);
}
;
/* inc_args are +incdir+ arguments in order. */
inc_args
: inc_args inc_arg
| inc_arg
;
inc_arg : TOK_PLUSARG
{ char*tmp = substitutions($1);
process_include_dir(tmp);
free($1);
free(tmp);
}
;
/* inc_args are +incdir+ arguments in order. */
libext_args
: libext_args libext_arg
| libext_arg
;
libext_arg : TOK_PLUSARG
{ process_library2_switch($1);
free($1);
}
;
/* skip_args are arguments to a +word flag that is not otherwise
parsed. This rule matches them and releases the strings, so that
they can be safely ignored. */
skip_args
: skip_args skip_arg
| skip_arg
;
skip_arg : TOK_PLUSARG
{ free($1);
}
;
%%
int yyerror(const char*msg)
{
return 0;
}
+67
View File
@@ -0,0 +1,67 @@
#ifndef __cfparse_misc_H
#define __cfparse_misc_H
/*
* Copyright (c) 2001 Picture Elements, Inc.
* Stephen Williams (steve@picturel.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: cfparse_misc.h,v 1.6 2004/02/15 18:03:30 steve Exp $"
#endif
/*
* The vlltype supports the passing of detailed source file location
* information between the lexical analyzer and the parser. Defining
* YYLTYPE compels the lexor to use this type and not something other.
*/
struct cfltype {
unsigned first_line;
unsigned first_column;
unsigned last_line;
unsigned last_column;
const char*text;
};
# define YYLTYPE struct cfltype
extern YYLTYPE yylloc;
int cflex(void);
int cferror(const char *);
int cfparse(void);
/*
* $Log: cfparse_misc.h,v $
* Revision 1.6 2004/02/15 18:03:30 steve
* Cleanup of warnings.
*
* Revision 1.5 2003/09/26 21:25:58 steve
* Warnings cleanup.
*
* Revision 1.4 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
* Revision 1.3 2002/01/02 02:39:34 steve
* Use my own cfltype to defend against bison 1.30.
*
* Revision 1.2 2001/11/12 18:47:32 steve
* Support +incdir in command files, and ignore other
* +args flags. Also ignore -a and -v flags.
*
* Revision 1.1 2001/11/12 01:26:36 steve
* More sophisticated command file parser.
*
*/
#endif
+113
View File
@@ -0,0 +1,113 @@
#ifndef __globals_H
#define __globals_H
/*
* Copyright (c) 2000 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: globals.h,v 1.21 2007/04/19 02:52:53 steve Exp $"
#endif
# include <stddef.h>
/* This is the base (i.e. -B<value>) of the Icarus Verilog files. */
extern const char*base;
/* This is the path to the iconfig file sent to ivl. */
extern char* iconfig_path;
extern char* iconfig_common_path;
/* Ths is the optional -M<dependfile> value, if one was supplied. */
extern const char*depfile;
/* Ths is the optional -N<path> value, if one was supplied. */
extern const char*npath;
/* This is the name of the output file that the user selected. */
extern const char*opath;
/* This pointer is set if there were -s<value> parameters. */
extern char*start;
/* This flag is true if the -S flag was used on the command line. */
extern int synth_flag;
/* This is the name of the selected target. */
extern const char*targ;
/* This is the integer-width argument that will be passed to ivl. */
extern unsigned integer_width;
/* Perform variable substitutions on the string. */
extern char* substitutions(const char*str);
/* Add the name to the list of source files. */
extern void process_file_name(const char*name, int lib_flag);
/* Add the name to the list of library directories. */
extern void process_library_switch(const char*name);
extern void process_library_nocase_switch(const char*name);
extern void process_library2_switch(const char*name);
/* Add a new include file search directory */
extern void process_include_dir(const char*name);
/* Add a new -D define. */
extern void process_define(const char*name);
/* -v */
extern int verbose_flag;
extern char warning_flags[];
/* -y and -Y flags from the command line. */
extern char* library_flags;
extern char* library_flags2;
/*
* $Log: globals.h,v $
* Revision 1.21 2007/04/19 02:52:53 steve
* Add support for -v flag in command file.
*
* Revision 1.20 2007/03/07 04:24:59 steve
* Make integer width controllable.
*
* Revision 1.19 2003/11/18 06:31:46 steve
* Remove the iverilog.conf file.
*
* Revision 1.18 2003/11/13 04:09:49 steve
* Pass flags through the temporary config file.
*
* Revision 1.17 2003/11/01 04:21:57 steve
* Add support for a target static config file.
*
* Revision 1.16 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
* Revision 1.15 2002/06/23 20:10:51 steve
* Variable substitution in command files.
*
* Revision 1.14 2002/05/28 20:40:37 steve
* ivl indexes the search path for libraries, and
* supports case insensitive module-to-file lookup.
*
* Revision 1.13 2002/05/28 00:50:40 steve
* Add the ivl -C flag for bulk configuration
* from the driver, and use that to run library
* modules through the preprocessor.
*/
#endif
+376
View File
@@ -0,0 +1,376 @@
.TH iverilog 1 "$Date: 2007/06/05 01:56:12 $" Version "$Date: 2007/06/05 01:56:12 $"
.SH NAME
iverilog - Icarus Verilog compiler
.SH SYNOPSIS
.B iverilog
[-ESVv] [-Bpath] [-ccmdfile] [-g1|-g2|-g2x|-gspecify-gxtypes] [-Dmacro[=defn]] [-pflag=value]
[-Iincludedir] [-mmodule] [-Mfile] [-Nfile] [-ooutputfilename]
[-stopmodule] [-ttype] [-Tmin/typ/max] [-Wclass] [-ypath] sourcefile
.SH DESCRIPTION
.PP
\fIiverilog\fP is a compiler that translates Verilog source code into
executable programs for simulation, or other netlist formats for
further processing. The currently supported targets are \fIvvp\fP for
simulation, and \fIxnf\fP and \fIfpga\fP for synthesis. Other target
types are added as code generators are implemented.
.SH OPTIONS
.l
\fIiverilog\fP accepts the following options:
.TP 8
.B -B\fIbase\fP
The \fIiverilog\fP program uses external programs and configuration
files to preprocess and compile the Verilog source. Normally, the path
used to locate these tools is built into the \fIiverilog\fP
program. However, the \fB-B\fP switch allows the user to select a
different set of programs. The path given is used to locate
\fIivlpp\fP, \fIivl\fP, code generators and the VPI modules.
.TP 8
.B -c\fIfile\fP
This flag specifies an input file that contains a list of Verilog
source files. This is similar to the \fIcommand file\fP of other
Verilog simulators, in that it is a file that contains the file names
instead of taking them on the command line. See \fBCommand Files\fP below.
.TP 8
.B -D\fImacro\fP
Defines macro \fImacro\fP with the string `1' as its definition. This
form is normally only used to trigger ifdef conditionals in the
Verilog source.
.TP 8
.B -D\fImacro=defn\fP
Defines macro \fImacro\fP as \fIdefn\fP.
.TP 8
.B -E
Preprocess the Verilog source, but do not compile it. The output file
is the Verilog input, but with file inclusions and macro references
expanded and removed. This is useful, for example, to preprocess
Verilog source for use by other compilers.
.TP 8
.B -g1\fI|\fP-g2\fI|\fP-g2x
Select the Verilog language \fIgeneration\fP to support in the
compiler. This selects between \fIIEEE1364-1995\fP(1),
\fIIEEE1364-2001\fP(2), or \fIVerilog with extension\fP(2x). Normally,
Icarus Verilog defaults to the latest known generation of the
language. This flag is most useful to restrict the language to a set
supported by tools of specific generations, for compatibility with
other tools.
.TP 8
.B -gspecify\fI|\fP-gno-specify
Enable (default) or disable specify block support. When enabled,
specify block code is elaborated. When disabled, specify blocks are
parsed but ignored. Specify blocks are commonly not needed for RTL
simulation, and in fact can hurt performance of the
simulation. However, disabling specify blocks reduces accuracy of
full-timing simulations.
.TP 8
.B -gxtypes\fI|\fP-gno-xtypes
Enable (default) or disable support for extended types. Enabling
extended types allows for new types that are supported by Icarus
Verilog as extensions beyond the baseline Verilog. It may be necessary
to disable extended types if compiling code that clashes with the few
new keywords used to implement the type system.
.TP 8
.B -I\fIincludedir\fP
Append directory \fIincludedir\fP to list of directories searched
for Verilog include files. The \fB-I\fP switch may be used many times
to specify several directories to search, the directories are searched
in the order they appear on the command line.
.TP 8
.B -M\fIpath\fP
Write into the file specified by path a list of files that contribute
to the compilation of the design. This includes files that are
included by include directives and files that are automatically loaded
by library support. The output is one file name per line, with no
leading or trailing space.
.TP 8
.B -m\fImodule\fP
Add this module to the list of VPI modules to be loaded by the
simulation. Many modules can be specified, and all will be loaded, in
the order specified. The system module is implicit and always included.
If a System Function Table file (<module>.sft) exists for the module it
will be loaded automatically.
.TP 8
.B -N\fIpath\fP
This is used for debugging the compiler proper. Dump the final netlist
form of the design to the specified file. It otherwise does not affect
operation of the compiler. The dump happens after the design is
elaborated and optimized.
.TP 8
.B -o \fIfilename\fP
Place output in the file \fIfilename\fP. If no output file name is
specified, \fIiverilog\fP uses the default name \fBa.out\fP.
.TP 8
.B -p\fIflag=value\fP
Assign a value to a target specific flag. The \fB-p\fP switch may be
used as often as necessary to specify all the desired flags. The flags
that are used depend on the target that is selected, and are described
in target specific documentation. Flags that are not used are ignored.
.TP 8
.B -S
Synthesize. Normally, if the target can accept behavioral
descriptions the compiler will leave processes in behavioral
form. The \fB-S\fP switch causes the compiler to perform synthesis
even if it is not necessary for the target. If the target type is a
netlist format, the \fB-S\fP switch is unnecessary and has no effect.
.TP 8
.B -s \fItopmodule\fP
Specify the top level module to elaborate. Icarus Verilog will by default
choose modules that are not instantiated in any other modules, but
sometimes that is not sufficient, or instantiates too many modules. If
the user specifies one or more root modules with \fB-s\fP flags, then
they will be used as root modules instead.
.TP 8
.B -T\fImin|typ|max\fP
Use this switch to select min, typ or max times from min:typ:max
expressions. Normally, the compiler will simply use the typ value from
these expressions (with a warning) but this switch will tell the
compiler explicitly which value to use. This will suppress the
warning that the compiler is making a choice.
.TP 8
.B -t\fItarget\fP
Use this switch to specify the target output format. See the
\fBTARGETS\fP section below for a list of valid output formats.
.TP 8
.B -v
Turn on verbose messages. This will print the command lines that are
executed to perform the actual compilation, along with version
information from the various components, as well as the version of the
product as a whole. You will notice that the command lines include
a reference to a key temporary file that passes information to the
compiler proper. To keep that file from being deleted at the end
of the process, provide a file name of your own in the environment
variable \fBIVERILOG_ICONFIG\fP.
.TP 8
.B -V
Print the version of the compiler, and exit.
.TP 8
.B -W\fIclass\fP
Turn on different classes of warnings. See the \fBWARNING TYPES\fP
section below for descriptions of the different warning groups. If
multiple \fB-W\fP switches are used, the warning set is the union of
all the requested classes.
.TP 8
.B -y\fIlibdir\fP
Append the directory to the library module search path. When the
compiler finds an undefined module, it looks in these directories for
files with the right name.
.SH MODULE LIBRARIES
The Icarus Verilog compiler supports module libraries as directories
that contain Verilog source files. During elaboration, the compiler
notices the instantiation of undefined module types. If the user
specifies library search directories, the compiler will search the
directory for files with the name of the missing module type. If it
finds such a file, it loads it as a Verilog source file, they tries
again to elaborate the module.
Library module files should contain only a single module, but this is
not a requirement. Library modules may reference other modules in the
library or in the main design.
.SH TARGETS
The Icarus Verilog compiler supports a variety of targets, for
different purposes, and the \fB-t\fP switch is used to select the
desired target.
.TP 8
.B null
The null target causes no code to be generated. It is useful for
checking the syntax of the Verilog source.
.TP 8
.B vvp
This is the default. The vvp target generates code for the vvp
runtime. The output is a complete program that simulates the design
but must be run by the \fBvvp\fP command.
.TP 8
.B xnf
This is the Xilinx Netlist Format used by many tools for placing
devices in FPGAs or other programmable devices. This target is
obsolete, use the \fBfpga\fP target instead.
.TP 8
.B fpga
This is a synthesis target that supports a variety of fpga devices,
mostly by EDIF format output. The Icarus Verilog fpga code generator
can generate complete designs or EDIF macros that can in turn be
imported into larger designs by other tools. The \fBfpga\fP target
implies the synthesis \fB-S\fP flag.
.SH "WARNING TYPES"
These are the types of warnings that can be selected by the \fB-W\fP
switch. All the warning types (other than \fBall\fP) can also be
prefixed with \fBno-\fP to turn off that warning. This is most useful
after a \fB-Wall\fP argument to suppress isolated warning types.
.TP 8
.B all
This enables all supported warning categories.
.TP 8
.B implicit
This enables warnings for creation of implicit declarations. For
example, if a scalar wire X is used but not declared in the Verilog
source, this will print a warning at its first use.
.TP 8
.B portbind
This enables warnings for ports of module instantiations that are not
connected but probably should be. Dangling input ports, for example,
will generate a warning.
.TP 8
.B timescale
This enables warnings for inconsistent use of the timescale
directive. It detects if some modules have no timescale, or if modules
inherit timescale from another file. Both probably mean that
timescales are inconsistent, and simulation timing can be confusing
and dependent on compilation order.
.SH "SYSTEM FUNCTION TABLE FILES"
If the source file name as a \fB.sft\fP suffix, then it is taken to be
a system function table file. A System function table file is used to
describe to the compiler the return types for system functions. This
is necessary because the compiler needs this information to elaborate
expressions that contain these system functions, but cannot run the
sizetf functions since it has no run-time.
The format of the table is ASCII, one function per line. Empty lines
are ignored, and lines that start with the '\fI#\fP' character are
comment lines. Each non-comment line starts with the function name,
then the vpi type (i.e. vpiSysFuncReal). The following types are
supported:
.TP 8
.B vpiSysFuncReal
The function returns a real/realtime value.
.TP 8
.B vpiSysFuncInt
The function returns an integer.
.TP 8
.B vpiSysFuncSized <wid> <signed|unsigned>
The function returns a vector with the given width, and is signed or
unsigned according to the flag.
.SH "COMMAND FILES"
The command file allows the user to place source file names and
certain command line switches into a text file instead of on a long
command line. Command files can include C or C++ style comments, as
well as # comments, if the # starts the line.
.TP 8
.I "file name"
A simple file name or file path is taken to be the name of a Verilog
source file. The path starts with the first non-white-space
character. Variables are substituted in file names.
.TP 8
.B -y\ \fIlibdir\fP
A \fB-y\fP token prefixes a library directory in the command file,
exactly like it does on the command line. The parameter to the \fB-y\fP
flag may be on the same line or the next non-comment line.
Variables in the \fIlibdir\fP are substituted.
.TP 8
.B +incdir+\fIincludedir\fP
The \fB+incdir+\fP token in command files gives directories to search
for include files in much the same way that \fB-I\fP flags work on the
command line. The difference is that multiple \fI+includedir\fP
directories are valid parameters to a single \fB+incdir+\fP token,
although you may also have multiple \fB+incdir+\fP lines.
Variables in the \fIincludedir\fP are substituted.
.TP 8
.B +libext+\fIext\fP
The \fB+libext\fP token in command files fives file extensions to try
when looking for a library file. This is useful in conjunction with
\fB-y\fP flags to list suffixes to try in each directory before moving
on to the next library directory.
.TP 8
.B +libdir+\fIdir\fP
This is another way to specify library directories. See the -y flag.
.TP 8
.B +libdir-nocase+\fIdir\fP
This is like the \fB+libdir\fP statement, but file names inside the
directories declared here are case insensitive. The missing module
name in a lookup need not match the file name case, as long as the
letters are correct. For example, "foo" matches "Foo.v" but not
"bar.v".
.TP 8
.B +define+\fINAME\fP=\fIvalue\fP
The \fB+define+\fP token is the same as the \fB-D\fP option on the
command line. The value part of the token is optional.
.TP 8
.B +toupper-filename\fP
This token causes file names after this in the command file to be
translated to uppercase. This helps with situations where a directory
has passed through a DOS machine, and in the process the file names
become munged.
.TP 8
.B +tolower-filename\fP
This is similar to the \fB+toupper-filename\fP hack described above.
.TP 8
.B +integer-width+\fIvalue\fP
This allows the programmer to select the width for integer variables
in the Verilog source. The default is 32, the value can be any desired
integer value.
.SH "VARIABLES IN COMMAND FILES"
In certain cases, iverilog supports variables in command files. These
are strings of the form "$(\fIvarname\fP)", where \fIvarname\fP is the
name of the environment variable to read. The entire string is
replaced with the contents of that variable. Variables are only
substituted in contexts that explicitly support them, including file
and directory strings.
Variable values come from the operating system environment, and not
from preprocessor defines elsewhere in the file or the command line.
.SH EXAMPLES
These examples assume that you have a Verilog source file called hello.v in
the current directory
To compile hello.v to an executable file called a.out:
iverilog hello.v
To compile hello.v to an executable file called hello:
iverilog -o hello hello.v
To compile and run explicitly using the vvp runtime:
iverilog -ohello.vvp -tvvp hello.v
To compile hello.v to a file in XNF-format called hello.xnf
iverilog -txnf -ohello.xnf hello.v
.SH "AUTHOR"
.nf
Steve Williams ([email protected])
.SH SEE ALSO
vvp(1),
.BR "<http://www.icarus.com/eda/verilog/>"
.SH COPYRIGHT
.nf
Copyright \(co 2002 Stephen Williams
This document can be freely redistributed according to the terms of the
GNU General Public License version 2.0
+883
View File
@@ -0,0 +1,883 @@
/*
* Copyright (c) 2000-2005 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: main.c,v 1.76 2007/06/05 01:56:12 steve Exp $"
#endif
# include "config.h"
const char NOTICE[] =
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
" the Free Software Foundation; either version 2 of the License, or\n"
" (at your option) any later version.\n"
"\n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
" GNU General Public License for more details.\n"
"\n"
" You should have received a copy of the GNU General Public License\n"
" along with this program; if not, write to the Free Software\n"
" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n"
;
const char HELP[] =
"Usage: iverilog [-ESvV] [-B base] [-c cmdfile] [-g1|-g2|-g2x]\n"
" [-D macro[=defn]] [-I includedir] [-M depfile] [-m module]\n"
" [-N file] [-o filename] [-p flag=value]\n"
" [-s topmodule] [-t target] [-T min|typ|max]\n"
" [-W class] [-y dir] [-Y suf] source_file(s)\n"
"See man page for details.";
#define MAXSIZE 4096
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef __MINGW32__
#include <windows.h>
#ifdef HAVE_LIBIBERTY_H
#include <libiberty.h>
#endif
#endif
#if HAVE_GETOPT_H
#include <getopt.h>
#endif
#if defined(__MINGW32__) && !defined(HAVE_GETOPT_H)
extern int getopt(int argc, char*argv[], const char*fmt);
extern int optind;
extern const char*optarg;
#endif
#if !defined(WIFEXITED)
# define WIFEXITED(rc) ((rc&0x7f) == 0)
#endif
#if !defined(WEXITSTATUS)
# define WEXITSTATUS(rc) (rc>>8)
#endif
#ifndef IVL_ROOT
# define IVL_ROOT "."
#endif
# include "globals.h"
#include "cfparse_misc.h" /* cfparse() */
#ifdef __MINGW32__
const char sep = '\\';
#else
const char sep = '/';
#endif
extern void cfreset(FILE*fd, const char*path);
const char*base = 0;
const char*pbase = 0;
const char*mtm = 0;
const char*opath = "a.out";
const char*npath = 0;
const char*targ = "vvp";
const char*depfile = 0;
const char*generation = "2x";
const char*gen_specify = "specify";
const char*gen_xtypes = "xtypes";
char warning_flags[16] = "";
unsigned integer_width = 32;
char*mod_list = 0;
char*command_filename = 0;
/* These are used to collect the list of file names that will be
passed to ivlpp. Keep the list in a file because it can be a long
list. */
char*source_path = 0;
FILE*source_file = 0;
unsigned source_count = 0;
char*defines_path = 0;
FILE*defines_file = 0;
char*iconfig_path = 0;
FILE*iconfig_file = 0;
static char iconfig_common_path_buf[4096] = "";
char*iconfig_common_path = iconfig_common_path_buf;
int synth_flag = 0;
int verbose_flag = 0;
FILE *fp;
char line[MAXSIZE];
char tmp[MAXSIZE];
static char ivl_root[MAXSIZE];
/* Structure to keep a FIFO list of the command files */
typedef struct t_command_file {
char *filename;
struct t_command_file *next;
} s_command_file, *p_command_file;
p_command_file cmd_file_head = NULL; /* The FIFO head */
p_command_file cmd_file_tail = NULL; /* The FIFO tail */
/* Function to add a comamnd file name to the FIFO. */
void add_cmd_file(const char* filename)
{
p_command_file new;
new = (p_command_file) malloc(sizeof(s_command_file));
new->filename = strdup(filename);
new->next = NULL;
if (cmd_file_head == NULL) {
cmd_file_head = new;
cmd_file_tail = new;
} else {
cmd_file_tail->next = new;
cmd_file_tail = new;
}
}
/* Function to return the top comamnd file name from the FIFO. */
char *get_cmd_file()
{
char *filename;
if (cmd_file_head == NULL) filename = NULL;
else {
p_command_file head;
filename = cmd_file_head->filename;
head = cmd_file_head;
cmd_file_head = cmd_file_head->next;
free(head);
}
return filename;
}
#ifdef __MINGW32__
# include <io.h>
# include <fcntl.h>
static FILE*fopen_safe(const char*path)
{
FILE*file = 0;
int fd;
fd = _open(path, _O_WRONLY|_O_CREAT|_O_EXCL, 0700);
if (fd != -1)
file = _fdopen(fd, "w");
return file;
}
#else
# include <fcntl.h>
static FILE*fopen_safe(const char*path)
{
FILE*file = 0;
int fd;
fd = open(path, O_WRONLY|O_CREAT|O_EXCL, 0700);
if (fd != -1)
file = fdopen(fd, "w");
return file;
}
#endif
static const char*my_tempfile(const char*str, FILE**fout)
{
FILE*file;
int retry;
static char pathbuf[8192];
const char*tmpdir = getenv("TMP");
if (tmpdir == 0)
tmpdir = getenv("TMPDIR");
if (tmpdir == 0)
tmpdir = getenv("TEMP");
#ifdef __MINGW32__
if (tmpdir == 0)
tmpdir = "C:\\TEMP";
#else
if (tmpdir == 0)
tmpdir = "/tmp";
#endif
assert(tmpdir);
assert((strlen(tmpdir) + strlen(str)) < sizeof pathbuf - 10);
srand(getpid());
retry = 100;
file = NULL;
while ((retry > 0) && (file == NULL)) {
unsigned code = rand();
sprintf(pathbuf, "%s%c%s%04x", tmpdir, sep, str, code);
file = fopen_safe(pathbuf);
retry -= 1;
}
*fout = file;
return pathbuf;
}
/*
* This is the default target type. It looks up the bits that are
* needed to run the command from the configuration file (which is
* already parsed for us) so we can handle must of the generic cases.
*/
static int t_default(char*cmd, unsigned ncmd)
{
unsigned rc;
#ifdef __MINGW32__
unsigned ncmd_start = ncmd;
#endif
snprintf(tmp, sizeof tmp, " | %s/ivl", base);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
if (verbose_flag) {
const char*vv = " -v";
rc = strlen(vv);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, vv);
ncmd += rc;
}
if (npath != 0) {
snprintf(tmp, sizeof tmp, " -N%s", npath);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
}
snprintf(tmp, sizeof tmp, " -C%s", iconfig_path);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
snprintf(tmp, sizeof tmp, " -C%s -- -", iconfig_common_path);
rc = strlen(tmp);
cmd = realloc(cmd, ncmd+rc+1);
strcpy(cmd+ncmd, tmp);
ncmd += rc;
#ifdef __MINGW32__
{
char *t;
for (t = cmd+ncmd_start; *t; t++)
{
if (*t == '/') *t = '\\';
}
}
#endif
if (verbose_flag)
printf("translate: %s\n", cmd);
rc = system(cmd);
if ( ! getenv("IVERILOG_ICONFIG")) {
remove(source_path);
remove(iconfig_path);
remove(defines_path);
}
if (rc != 0) {
if (rc == 127) {
fprintf(stderr, "Failed to execute: %s\n", cmd);
return 1;
}
if (WIFEXITED(rc))
return WEXITSTATUS(rc);
fprintf(stderr, "Command signaled: %s\n", cmd);
return -1;
}
return 0;
}
static void process_warning_switch(const char*name)
{
if (strcmp(name,"all") == 0) {
strcat(warning_flags, "ipt");
} else if (strcmp(name,"implicit") == 0) {
if (! strchr(warning_flags+2, 'i'))
strcat(warning_flags, "i");
} else if (strcmp(name,"portbind") == 0) {
if (! strchr(warning_flags+2, 'p'))
strcat(warning_flags, "p");
} else if (strcmp(name,"timescale") == 0) {
if (! strchr(warning_flags+2, 't'))
strcat(warning_flags, "t");
} else if (strcmp(name,"no-implicit") == 0) {
char*cp = strchr(warning_flags+2, 'i');
if (cp) while (*cp) {
cp[0] = cp[1];
cp += 1;
}
} else if (strcmp(name,"no-portbind") == 0) {
char*cp = strchr(warning_flags+2, 'p');
if (cp) while (*cp) {
cp[0] = cp[1];
cp += 1;
}
} else if (strcmp(name,"no-timescale") == 0) {
char*cp = strchr(warning_flags+2, 't');
if (cp) while (*cp) {
cp[0] = cp[1];
cp += 1;
}
}
}
void process_library_switch(const char *name)
{
fprintf(iconfig_file, "-y:%s\n", name);
}
void process_library_nocase_switch(const char *name)
{
fprintf(iconfig_file, "-yl:%s\n", name);
}
void process_library2_switch(const char *name)
{
fprintf(iconfig_file, "-Y:%s\n", name);
}
void process_include_dir(const char *name)
{
fprintf(defines_file, "I:%s\n", name);
}
void process_define(const char*name)
{
fprintf(defines_file,"D:%s\n", name);
}
/*
* This function is called while processing a file name in a command
* file, or a file name on the command line. Look to see if there is a
* .sft suffix, and if so pass that as a sys_func file. Otherwise, it
* is a Verilog source file to be written into the file list.
*/
void process_file_name(const char*name, int lib_flag)
{
if (strlen(name) > 4 && strcasecmp(".sft", name+strlen(name)-4) == 0) {
fprintf(iconfig_file,"sys_func:%s\n", name);
} else {
fprintf(source_file, "%s\n", name);
source_count += 1;
if (lib_flag)
fprintf(iconfig_file,"library_file:%s\n", name);
}
}
int process_generation(const char*name)
{
if (strcmp(name,"1") == 0)
generation = "1";
else if (strcmp(name,"2") == 0)
generation = "2";
else if (strcmp(name,"2x") == 0)
generation = "2x";
else if (strcmp(name,"xtypes") == 0)
gen_xtypes = "xtypes";
else if (strcmp(name,"no-xtypes") == 0)
gen_xtypes = "no-xtypes";
else if (strcmp(name,"specify") == 0)
gen_specify = "specify";
else if (strcmp(name,"no-specify") == 0)
gen_specify = "no-specify";
else {
fprintf(stderr, "Unknown/Unsupported Language generation "
"%s\n", name);
fprintf(stderr, "Supported generations are:\n");
fprintf(stderr, " 1 -- IEEE1364-1995 (Verilog 1)\n"
" 2 -- IEEE1364-2001 (Verilog 2001)\n"
" 2x -- Verilog with extensions\n"
"Other generation flags:\n"
" specify | no-specify\n"
" xtypes | no-xtypes\n");
return 1;
}
return 0;
}
/*
* If it exists add the SFT file for the given module.
*/
void add_sft_file(const char *module)
{
char *file;
file = (char *) malloc(strlen(base)+1+strlen(module)+4+1);
sprintf(file, "%s%c%s.sft", base, sep, module);
if (access(file, R_OK) == 0)
fprintf(iconfig_file, "sys_func:%s\n", file);
free(file);
}
int main(int argc, char **argv)
{
char*cmd;
unsigned ncmd;
int e_flag = 0;
int version_flag = 0;
int opt, idx, rc;
#ifdef __MINGW32__
{ char * s;
char basepath[1024];
GetModuleFileName(NULL,basepath,1024);
/* Calculate the ivl_root from the path to the command. This
is necessary because of the installation process in
Windows. Mostly, it is those darn drive letters, but oh
well. We know the command path is formed like this:
D:\iverilog\bin\iverilog.exe
The IVL_ROOT in a Windows installation is the path:
D:\iverilog\lib\ivl
so we chop the file name and the last directory by
turning the last two \ characters to null. Then we append
the lib\ivl to finish. */
strncpy(ivl_root, basepath, MAXSIZE);
s = strrchr(ivl_root, sep);
if (s) *s = 0;
s = strrchr(ivl_root, sep);
if (s) *s = 0;
strcat(ivl_root, "\\lib\\ivl");
base = ivl_root;
}
#else
/* In a UNIX environment, the IVL_ROOT from the Makefile is
dependable. It points to the $prefix/lib/ivl directory,
where the sub-parts are installed. */
strcpy(ivl_root, IVL_ROOT);
base = ivl_root;
#endif
/* Create a temporary file for communicating input parameters
to the preprocessor. */
source_path = strdup(my_tempfile("ivrlg", &source_file));
if (NULL == source_file) {
fprintf(stderr, "%s: Error opening temporary file %s\n",
argv[0], source_path);
fprintf(stderr, "%s: Please check TMP or TMPDIR.\n", argv[0]);
return 1;
}
defines_path = strdup(my_tempfile("ivrlg2", &defines_file));
if (NULL == defines_file) {
fprintf(stderr, "%s: Error opening temporary file %s\n",
argv[0], defines_path);
fprintf(stderr, "%s: Please check TMP or TMPDIR.\n", argv[0]);
fclose(source_file);
remove(source_path);
return 1;
}
fprintf(defines_file, "D:__ICARUS__=1\n");
/* Create another temporary file for passing configuration
information to ivl. */
if ( (iconfig_path = getenv("IVERILOG_ICONFIG")) ) {
fprintf(stderr, "%s: IVERILOG_ICONFIG=%s\n",
argv[0], iconfig_path);
iconfig_file = fopen(iconfig_path, "w");
} else {
iconfig_path = strdup(my_tempfile("ivrlh", &iconfig_file));
}
if (NULL == iconfig_file) {
fprintf(stderr, "%s: Error opening temporary file %s\n",
argv[0], iconfig_path);
fprintf(stderr, "%s: Please check TMP or TMPDIR.\n", argv[0]);
fclose(source_file);
remove(source_path);
fclose(defines_file);
remove(defines_path);
return 1;
}
while ((opt = getopt(argc, argv, "B:c:D:Ef:g:hI:M:m:N::o:p:Ss:T:t:vVW:y:Y:")) != EOF) {
switch (opt) {
case 'B':
/* Undocumented feature: The preprocessor itself
may be located at a different location. If the
base starts with a 'P', set this special base
instead of the main base. */
if (optarg[0] == 'P') {
pbase = optarg+1;
} else {
base=optarg;
}
break;
case 'c':
add_cmd_file(optarg);
break;
case 'D':
process_define(optarg);
break;
case 'E':
e_flag = 1;
break;
case 'f':
fprintf(stderr, "warning: The -f flag is moved to -p\n");
case 'p':
fprintf(iconfig_file, "flag:%s\n", optarg);
break;
case 'g':
rc = process_generation(optarg);
if (rc != 0)
return -1;
break;
case 'h':
fprintf(stderr, "%s\n", HELP);
return 1;
case 'I':
process_include_dir(optarg);
break;
case 'M':
depfile = optarg;
break;
case 'm':
fprintf(iconfig_file, "module:%s\n", optarg);
add_sft_file(optarg);
break;
case 'N':
npath = optarg;
break;
case 'o':
opath = optarg;
break;
case 'S':
synth_flag = 1;
break;
case 's':
fprintf(iconfig_file, "root:%s\n", optarg);
break;
case 'T':
if (strcmp(optarg,"min") == 0) {
mtm = "min";
} else if (strcmp(optarg,"typ") == 0) {
mtm = "typ";
} else if (strcmp(optarg,"max") == 0) {
mtm = "max";
} else {
fprintf(stderr, "%s: invalid -T%s argument\n",
argv[0], optarg);
return 1;
}
break;
case 't':
targ = optarg;
break;
case 'v':
verbose_flag = 1;
break;
case 'V':
version_flag = 1;
break;
case 'W':
process_warning_switch(optarg);
break;
case 'y':
process_library_switch(optarg);
break;
case 'Y':
process_library2_switch(optarg);
break;
case '?':
default:
return 1;
}
}
if (pbase == 0)
pbase = base;
if (version_flag || verbose_flag) {
printf("Icarus Verilog version " VERSION " ($Name: $)\n");
printf("Copyright 1998-2003 Stephen Williams\n");
puts(NOTICE);
if (version_flag)
return 0;
}
/* Make a common conf file path to reflect the target. */
sprintf(iconfig_common_path, "%s%c%s%s.conf",
base,sep, targ, synth_flag? "-s" : "");
/* Write values to the iconfig file. */
fprintf(iconfig_file, "basedir:%s\n", base);
/* Tell the core where to find the system.sft. This file
describes the system functions so that elaboration knows
how to handle them. */
fprintf(iconfig_file, "sys_func:%s%csystem.sft\n", base, sep);
if (mtm != 0) fprintf(iconfig_file, "-T:%s\n", mtm);
fprintf(iconfig_file, "generation:%s\n", generation);
fprintf(iconfig_file, "generation:%s\n", gen_specify);
fprintf(iconfig_file, "generation:%s\n", gen_xtypes);
fprintf(iconfig_file, "warnings:%s\n", warning_flags);
fprintf(iconfig_file, "out:%s\n", opath);
if (depfile) fprintf(iconfig_file, "depfile:%s\n", depfile);
while ( (command_filename = get_cmd_file()) ) {
int rc;
if (( fp = fopen(command_filename, "r")) == NULL ) {
fprintf(stderr, "%s: Can't open %s\n",
argv[0], command_filename);
return 1;
}
cfreset(fp, command_filename);
rc = cfparse();
if (rc != 0) {
fprintf(stderr, "%s: error reading command file\n",
command_filename);
return 1;
}
free(command_filename);
}
if (depfile) {
fprintf(defines_file, "M:%s\n", depfile);
}
/* Finally, process all the remaining words on the command
line as file names. */
for (idx = optind ; idx < argc ; idx += 1)
process_file_name(argv[idx], 0);
fclose(source_file);
source_file = 0;
fclose(defines_file);
defines_file = 0;
if (source_count == 0) {
fprintf(stderr, "%s: No input files.\n", argv[0]);
fprintf(stderr, "%s\n", HELP);
return 1;
}
/* Start building the preprocess command line. */
sprintf(tmp, "%s%civlpp %s%s -F%s -f%s ", pbase,sep,
verbose_flag?" -v":"",
e_flag?"":" -L", defines_path, source_path);
ncmd = strlen(tmp);
cmd = malloc(ncmd + 1);
strcpy(cmd, tmp);
/* If the -E flag was given on the command line, then all we
do is run the preprocessor and put the output where the
user wants it. */
if (e_flag) {
int rc;
if (strcmp(opath,"-") != 0) {
sprintf(tmp, " > %s", opath);
cmd = realloc(cmd, ncmd+strlen(tmp)+1);
strcpy(cmd+ncmd, tmp);
ncmd += strlen(tmp);
}
if (verbose_flag)
printf("preprocess: %s\n", cmd);
rc = system(cmd);
remove(source_path);
fclose(iconfig_file);
if ( ! getenv("IVERILOG_ICONFIG"))
remove(iconfig_path);
if (rc != 0) {
if (WIFEXITED(rc)) {
fprintf(stderr, "errors preprocessing Verilog program.\n");
return WEXITSTATUS(rc);
}
fprintf(stderr, "Command signaled: %s\n", cmd);
return -1;
}
return 0;
}
fprintf(iconfig_file, "iwidth:%u\n", integer_width);
/* Write the preprocessor command needed to preprocess a
single file. This may be used to preprocess library
files. */
fprintf(iconfig_file, "ivlpp:%s%civlpp -L -F%s\n",
pbase, sep, defines_path);
/* Done writing to the iconfig file. Close it now. */
fclose(iconfig_file);
return t_default(cmd, ncmd);
return 0;
}
/*
* $Log: main.c,v $
* Revision 1.76 2007/06/05 01:56:12 steve
* Bring in .SFT file automatically if -m used.
*
* Revision 1.75 2007/04/19 02:52:53 steve
* Add support for -v flag in command file.
*
* Revision 1.74 2007/04/18 03:23:38 steve
* Add support for multiple command files. (Cary R.)
*
* Revision 1.73 2007/03/07 04:24:59 steve
* Make integer width controllable.
*
* Revision 1.72 2006/10/02 18:15:47 steve
* Fix handling of dep path in new argument passing method.
*
* Revision 1.71 2006/09/28 04:35:18 steve
* Support selective control of specify and xtypes features.
*
* Revision 1.70 2006/09/20 22:30:52 steve
* Do not pass -D__ICARUS__ to ivlpp.
*
* Revision 1.69 2006/07/26 00:11:40 steve
* Pass depfiles through temp defines file.
*
* Revision 1.68 2006/07/26 00:02:48 steve
* Pass defines and includes through temp file.
*
* Revision 1.67 2005/07/14 23:38:44 steve
* Display as version 0.9.devel
*
* Revision 1.66 2005/06/28 04:25:55 steve
* Remove reference to SystemVerilog.
*
* Revision 1.65 2004/06/17 14:47:22 steve
* Add a .sft file for the system functions.
*
* Revision 1.64 2004/03/10 04:51:25 steve
* Add support for system function table files.
*
* Revision 1.63 2004/02/15 18:03:30 steve
* Cleanup of warnings.
*
* Revision 1.62 2003/12/12 04:36:48 steve
* Fix make check to support -tconf configuration method.
*
* Revision 1.61 2003/11/18 06:31:46 steve
* Remove the iverilog.conf file.
*
* Revision 1.60 2003/11/13 05:55:33 steve
* Move the DLL= flag to target config files.
*
* Revision 1.59 2003/11/13 04:09:49 steve
* Pass flags through the temporary config file.
*
* Revision 1.58 2003/11/01 04:21:57 steve
* Add support for a target static config file.
*
* Revision 1.57 2003/10/26 22:43:42 steve
* Improve -V messages,
*
* Revision 1.56 2003/09/26 21:25:58 steve
* Warnings cleanup.
*
* Revision 1.55 2003/09/23 05:57:15 steve
* Pass -m flag from driver via iconfig file.
*
* Revision 1.54 2003/09/22 01:12:09 steve
* Pass more ivl arguments through the iconfig file.
*
* Revision 1.53 2003/08/26 16:26:02 steve
* ifdef idents correctly.
*
* Revision 1.52 2003/02/22 04:55:36 steve
* portbind adds p, not i, flag.
*
* Revision 1.51 2003/02/22 04:12:49 steve
* Add the portbind warning.
*/
+115
View File
@@ -0,0 +1,115 @@
/*
* Copyright (c) 2002 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: substit.c,v 1.5 2003/12/19 01:27:10 steve Exp $"
#endif
# include <string.h>
# include <stdlib.h>
#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
char* substitutions(const char*str)
{
size_t nbuf = strlen(str) + 1;
char*buf = malloc(nbuf);
char*cp = buf;
while (*str) {
if ((str[0] == '$') && (str[1] == '(')) {
/* If I find a $(x) string in the source, replace
it in the destination with the contents of the
environment variable x. */
char*name;
char*value;
const char*ep = strchr(str, ')');
str += 2;
name = malloc(ep-str+1);
strncpy(name, str, ep-str);
name[ep-str] = 0;
str = ep + 1;
value = getenv(name);
free(name);
if (value == 0)
continue;
if (strlen(value) >= (nbuf - (cp-buf))) {
size_t old_size = cp - buf;
nbuf = (cp - buf) + strlen(value) + 1;
buf = realloc(buf, nbuf);
cp = buf + old_size;
}
strcpy(cp, value);
cp += strlen(cp);
} else {
if ( cp == (buf + nbuf) ) {
size_t old_size = nbuf;
nbuf = old_size + 32;
buf = realloc(buf, nbuf);
cp = buf + old_size;
}
*cp++ = *str++;
}
}
/* Add the trailing nul to the string, and reallocate the
buffer to be a tight fit. */
if ( cp == (buf + nbuf) ) {
size_t old_size = nbuf;
nbuf = old_size + 1;
buf = realloc(buf, nbuf);
buf[old_size] = 0;
} else {
*cp++ = 0;
nbuf = cp - buf;
buf = realloc(buf, nbuf);
}
return buf;
}
/*
* $Log: substit.c,v $
* Revision 1.5 2003/12/19 01:27:10 steve
* Fix various unsigned compare warnings.
*
* Revision 1.4 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
* Revision 1.3 2002/08/11 23:47:04 steve
* Add missing Log and Ident strings.
*
* Revision 1.2 2002/06/25 01:33:01 steve
* include malloc.h only when available.
*
* Revision 1.1 2002/06/23 20:10:51 steve
* Variable substitution in command files.
*
*/
+173 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Stephen Williams (steve@icarus.com)
* Copyright (c) 1999-2002 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,26 +16,192 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: dup_expr.cc,v 1.2 2000/02/23 02:56:54 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: dup_expr.cc,v 1.21 2006/11/04 06:10:13 steve Exp $"
#endif
# include "config.h"
# include "netlist.h"
# include <cassert>
NetEBComp* NetEBComp::dup_expr() const
{
NetEBComp*result = new NetEBComp(op_, left_->dup_expr(),
right_->dup_expr());
return result;
}
NetEConst* NetEConst::dup_expr() const
{
NetEConst*tmp = new NetEConst(value_);
tmp->set_line(*this);
return tmp;
}
NetEConstParam* NetEConstParam::dup_expr() const
{
NetEConstParam*tmp = new NetEConstParam(scope_, name_, value());
tmp->set_line(*this);
return tmp;
}
NetECRealParam* NetECRealParam::dup_expr() const
{
NetECRealParam*tmp = new NetECRealParam(scope_, name_, value());
tmp->set_line(*this);
return tmp;
}
NetEEvent* NetEEvent::dup_expr() const
{
assert(0);
return 0;
}
NetEScope* NetEScope::dup_expr() const
{
assert(0);
return 0;
}
NetESelect* NetESelect::dup_expr() const
{
return new NetESelect(expr_->dup_expr(),
base_? base_->dup_expr() : 0,
expr_width());
}
NetESFunc* NetESFunc::dup_expr() const
{
NetESFunc*tmp = new NetESFunc(name_, type_, expr_width(), nparms());
assert(tmp);
tmp->cast_signed(has_sign());
for (unsigned idx = 0 ; idx < nparms() ; idx += 1) {
assert(tmp->parm(idx));
tmp->parm(idx, tmp->parm(idx)->dup_expr());
}
return tmp;
}
NetESignal* NetESignal::dup_expr() const
{
NetESignal*tmp = new NetESignal(net_);
assert(tmp);
tmp->expr_width(expr_width());
return tmp;
}
NetETernary* NetETernary::dup_expr() const
{
NetETernary*tmp = new NetETernary(cond_->dup_expr(),
true_val_->dup_expr(),
false_val_->dup_expr());
return tmp;
}
NetEUFunc* NetEUFunc::dup_expr() const
{
NetEUFunc*tmp;
svector<NetExpr*> tmp_parms (parms_.count());
for (unsigned idx = 0 ; idx < tmp_parms.count() ; idx += 1) {
assert(parms_[idx]);
tmp_parms[idx] = parms_[idx]->dup_expr();
}
tmp = new NetEUFunc(func_, result_sig_->dup_expr(), tmp_parms);
assert(tmp);
return tmp;
}
NetEUnary* NetEUnary::dup_expr() const
{
NetEUnary*tmp = new NetEUnary(op_, expr_->dup_expr());
assert(tmp);
return tmp;
}
NetEUReduce* NetEUReduce::dup_expr() const
{
NetEUReduce*tmp = new NetEUReduce(op_, expr_->dup_expr());
assert(tmp);
return tmp;
}
/*
* $Log: dup_expr.cc,v $
* Revision 1.2 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
* Revision 1.21 2006/11/04 06:10:13 steve
* Handle dup of pad as well as normal select.
*
* Revision 1.1 1999/11/27 19:07:57 steve
* Support the creation of scopes.
* Revision 1.20 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.19 2004/12/11 02:31:25 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
* down this path.
*
* Revision 1.18 2004/06/17 16:06:18 steve
* Help system function signedness survive elaboration.
*
* Revision 1.17 2004/05/31 23:34:36 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better
* speed and more type support.
*
* Revision 1.16 2003/10/31 02:47:11 steve
* NetEUReduce has its own dup_expr method.
*
* Revision 1.15 2003/05/30 02:55:32 steve
* Support parameters in real expressions and
* as real expressions, and fix multiply and
* divide with real results.
*
* Revision 1.14 2003/04/22 04:48:29 steve
* Support event names as expressions elements.
*
* Revision 1.13 2003/03/15 18:08:43 steve
* Comparison operators do have defined width.
*
* Revision 1.12 2003/03/15 04:46:28 steve
* Better organize the NetESFunc return type guesses.
*
* Revision 1.11 2003/03/10 23:40:53 steve
* Keep parameter constants for the ivl_target API.
*
* Revision 1.10 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
*
* Revision 1.9 2002/11/09 00:25:27 steve
* Add dup_expr for user defined function calls.
*
* Revision 1.8 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.7 2002/01/28 00:52:41 steve
* Add support for bit select of parameters.
* This leads to a NetESelect node and the
* vvp code generator to support that.
*
* Revision 1.6 2001/11/19 01:54:14 steve
* Port close cropping behavior from mcrgb
* Move window array reset to libmc.
*
* Revision 1.5 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.4 2000/05/07 18:20:07 steve
* Import MCD support from Stephen Tell, and add
* system function parameter support to the IVL core.
*
* Revision 1.3 2000/05/04 03:37:58 steve
* Add infrastructure for system functions, move
* $time to that structure and add $random.
*/
+214
View File
@@ -0,0 +1,214 @@
/*
* Copyright (c) 2000-2003 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_anet.cc,v 1.13 2007/03/22 16:08:14 steve Exp $"
#endif
# include "config.h"
/*
* The elaborate_anet methods elaborate expressions that are intended
* to be the left side of procedural continuous assignments.
*/
# include "PExpr.h"
# include "netlist.h"
# include "netmisc.h"
# include <iostream>
NetNet* PExpr::elaborate_anet(Design*des, NetScope*scope) const
{
cerr << get_line() << ": error: Invalid expression on left side "
<< "of procedural continuous assignment." << endl;
return 0;
}
NetNet* PEConcat::elaborate_anet(Design*des, NetScope*scope) const
{
if (repeat_) {
cerr << get_line() << ": error: Repeat concatenations make "
"no sense in l-value expressions. I refuse." << endl;
des->errors += 1;
return 0;
}
svector<NetNet*>nets (parms_.count());
unsigned pins = 0;
unsigned errors = 0;
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
if (parms_[idx] == 0) {
cerr << get_line() << ": error: Empty expressions "
<< "not allowed in concatenations." << endl;
errors += 1;
continue;
}
nets[idx] = parms_[idx]->elaborate_anet(des, scope);
if (nets[idx] == 0)
errors += 1;
else
pins += nets[idx]->pin_count();
}
/* If any of the sub expressions failed to elaborate, then
delete all those that did and abort myself. */
if (errors) {
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
if (nets[idx]) delete nets[idx];
}
des->errors += 1;
return 0;
}
/* Make the temporary signal that connects to all the
operands, and connect it up. Scan the operands of the
concat operator from least significant to most significant,
which is opposite from how they are given in the list.
Allow for a repeat count other than 1 by repeating the
connect loop as many times as necessary. */
NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT_REG, pins);
/* Assume that all the data types are the same. */
osig->data_type(nets[0]->data_type());
pins = 0;
for (unsigned idx = nets.count() ; idx > 0 ; idx -= 1) {
NetNet*cur = nets[idx-1];
assert(cur->data_type() == osig->data_type());
for (unsigned pin = 0; pin < cur->pin_count(); pin += 1) {
connect(osig->pin(pins), cur->pin(pin));
pins += 1;
}
}
osig->local_flag(true);
return osig;
}
NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const
{
assert(scope);
NetNet* sig = 0;
NetMemory* mem = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
symbol_search(des, scope, path_, sig, mem, par, eve);
if (mem != 0) {
cerr << get_line() << ": error: memories not allowed "
<< "on left side of procedural continuous "
<< "assignment." << endl;
des->errors += 1;
return 0;
}
if (eve != 0) {
cerr << get_line() << ": error: named events not allowed "
<< "on left side of procedural continuous "
<< "assignment." << endl;
des->errors += 1;
return 0;
}
if (sig == 0) {
cerr << get_line() << ": error: reg ``" << path_ << "'' "
<< "is undefined in this scope." << endl;
des->errors += 1;
return 0;
}
switch (sig->type()) {
case NetNet::REG:
case NetNet::IMPLICIT_REG:
break;
default:
cerr << get_line() << ": error: " << path_ << " is not "
<< "a reg in this context." << endl;
des->errors += 1;
return 0;
}
assert(sig);
if (msb_ || lsb_) {
cerr << get_line() << ": error: bit/part selects not allowed "
<< "on left side of procedural continuous assignment."
<< endl;
des->errors += 1;
return 0;
}
return sig;
}
/*
* $Log: elab_anet.cc,v $
* Revision 1.13 2007/03/22 16:08:14 steve
* Spelling fixes from Larry
*
* Revision 1.12 2006/05/01 20:47:58 steve
* More explicit datatype setup.
*
* Revision 1.11 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.10 2004/10/04 01:10:52 steve
* Clean up spurious trailing white space.
*
* Revision 1.9 2003/09/19 03:50:12 steve
* Remove find_memory method from Design class.
*
* Revision 1.8 2003/06/21 01:21:43 steve
* Harmless fixup of warnings.
*
* Revision 1.7 2003/03/06 00:28:41 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.6 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.5 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
* Revision 1.4 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.3 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.2 2001/01/06 02:29:36 steve
* Support arrays of integers.
*
* Revision 1.1 2000/12/06 06:31:09 steve
* Check lvalue of procedural continuous assign (PR#29)
*
*/
+1663 -232
View File
File diff suppressed because it is too large Load Diff
+572
View File
@@ -0,0 +1,572 @@
/*
* Copyright (c) 2000-2006 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_lval.cc,v 1.44 2007/06/02 03:42:12 steve Exp $"
#endif
# include "config.h"
# include "PExpr.h"
# include "netlist.h"
# include "netmisc.h"
# include "compiler.h"
# include <iostream>
# include "ivl_assert.h"
/*
* These methods generate a NetAssign_ object for the l-value of the
* assignment. This is common code for the = and <= statements.
*
* What gets generated depends on the structure of the l-value. If the
* l-value is a simple name (i.e., foo <= <value>) the the NetAssign_
* is created the width of the foo reg and connected to all the
* bits.
*
* If there is a part select (i.e., foo[3:1] <= <value>) the NetAssign_
* is made only as wide as it needs to be (3 bits in this example) and
* connected to the correct bits of foo. A constant bit select is a
* special case of the part select.
*
* If the bit-select is non-constant (i.e., foo[<expr>] = <value>) the
* NetAssign_ is made wide enough to connect to all the bits of foo,
* then the mux expression is elaborated and attached to the
* NetAssign_ node as a b_mux value. The target must interpret the
* presence of a bmux value as taking a single bit and assigning it to
* the bit selected by the bmux expression.
*
* If the l-value expression is non-trivial, but can be fully
* evaluated at compile time (meaning any bit selects are constant)
* then elaboration will make a single NetAssign_ that connects to a
* synthetic reg that in turn connects to all the proper pins of the
* l-value.
*
* This last case can turn up in statements like: {a, b[1]} = c;
* rather then create a NetAssign_ for each item in the concatenation,
* elaboration makes a single NetAssign_ and connects it up properly.
*/
/*
* The default interpretation of an l-value to a procedural assignment
* is to try to make a net elaboration, and see if the result is
* suitable for assignment.
*/
NetAssign_* PExpr::elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const
{
NetNet*ll = 0;
if (ll == 0) {
cerr << get_line() << ": Assignment l-value too complex."
<< endl;
return 0;
}
NetAssign_*lv = new NetAssign_(ll);
return lv;
}
/*
* Concatenation expressions can appear as l-values. Handle them here.
*
* If adjacent l-values in the concatenation are not bit selects, then
* merge them into a single NetAssign_ object. This can happen is code
* like ``{ ...a, b, ...}''. As long as "a" and "b" do not have bit
* selects (or the bit selects are constant) we can merge the
* NetAssign_ objects.
*
* Be careful to get the bit order right. In the expression ``{a, b}''
* a is the MSB and b the LSB. Connect the LSB to the low pins of the
* NetAssign_ object.
*/
NetAssign_* PEConcat::elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const
{
if (repeat_) {
cerr << get_line() << ": error: Repeat concatenations make "
"no sense in l-value expressions. I refuse." << endl;
des->errors += 1;
return 0;
}
NetAssign_*res = 0;
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
if (parms_[idx] == 0) {
cerr << get_line() << ": error: Empty expressions "
<< "not allowed in concatenations." << endl;
des->errors += 1;
continue;
}
NetAssign_*tmp = parms_[idx]->elaborate_lval(des, scope, is_force);
/* If the l-value doesn't elaborate, the error was
already detected and printed. We just skip it and let
the compiler catch more errors. */
if (tmp == 0)
continue;
assert(tmp);
/* Link the new l-value to the previous one. */
NetAssign_*last = tmp;
while (last->more)
last = last->more;
last->more = res;
res = tmp;
}
return res;
}
/*
* Handle the ident as an l-value. This includes bit and part selects
* of that ident.
*/
NetAssign_* PEIdent::elaborate_lval(Design*des,
NetScope*scope,
bool is_force) const
{
NetNet* reg = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
symbol_search(des, scope, path_, reg, par, eve);
if (reg == 0) {
cerr << get_line() << ": error: Could not find variable ``"
<< path_ << "'' in ``" << scope_path(scope) <<
"''" << endl;
des->errors += 1;
return 0;
}
ivl_assert(*this, reg);
const name_component_t&name_tail = path_.back();
index_component_t::ctype_t use_sel = index_component_t::SEL_NONE;
if (!name_tail.index.empty())
use_sel = name_tail.index.back().sel;
// This is the special case that the l-value is an entire
// memory. This is, in fact, an error.
if (reg->array_dimensions() > 0 && name_tail.index.empty()) {
cerr << get_line() << ": error: Cannot assign to array "
<< path_ << ". Did you forget a word index?" << endl;
des->errors += 1;
return 0;
}
if (reg->array_dimensions() > 0)
return elaborate_lval_net_word_(des, scope, reg);
if (use_sel == index_component_t::SEL_PART) {
NetAssign_*lv = new NetAssign_(reg);
elaborate_lval_net_part_(des, scope, lv);
return lv;
}
if (use_sel == index_component_t::SEL_IDX_UP) {
NetAssign_*lv = new NetAssign_(reg);
elaborate_lval_net_idx_up_(des, scope, lv);
return lv;
}
if (use_sel == index_component_t::SEL_IDX_DO) {
NetAssign_*lv = new NetAssign_(reg);
elaborate_lval_net_idx_do_(des, scope, lv);
return lv;
}
/* Get the signal referenced by the identifier, and make sure
it is a register. Wires are not allows in this context,
unless this is the l-value of a force. */
if ((reg->type() != NetNet::REG) && !is_force) {
cerr << get_line() << ": error: " << path_ <<
" is not a valid l-value in " << scope_path(scope) <<
"." << endl;
cerr << reg->get_line() << ": : " << path_ <<
" is declared here as " << reg->type() << "." << endl;
des->errors += 1;
return 0;
}
long msb, lsb;
NetExpr*mux;
if (use_sel == index_component_t::SEL_BIT) {
const index_component_t&index_tail = name_tail.index.back();
ivl_assert(*this, index_tail.msb != 0);
ivl_assert(*this, index_tail.lsb == 0);
/* If there is only a single select expression, it is a
bit select. Evaluate the constant value and treat it
as a part select with a bit width of 1. If the
expression it not constant, then return the
expression as a mux. */
NetExpr*index_expr = elab_and_eval(des, scope, index_tail.msb, -1);
if (NetEConst*index_con = dynamic_cast<NetEConst*> (index_expr)) {
msb = index_con->value().as_long();
lsb = index_con->value().as_long();
mux = 0;
} else {
msb = 0;
lsb = 0;
mux = index_expr;
}
} else {
/* No select expressions, so presume a part select the
width of the register. */
msb = reg->msb();
lsb = reg->lsb();
mux = 0;
}
NetAssign_*lv;
if (mux) {
/* If there is a non-constant bit select, make a
NetAssign_ to the target reg and attach a
bmux to select the target bit. */
lv = new NetAssign_(reg);
/* Correct the mux for the range of the vector. */
if (reg->msb() < reg->lsb())
mux = make_sub_expr(reg->lsb(), mux);
else if (reg->lsb() != 0)
mux = make_add_expr(mux, - reg->lsb());
lv->set_part(mux, 1);
} else if (msb == reg->msb() && lsb == reg->lsb()) {
/* No bit select, and part select covers the entire
vector. Simplest case. */
lv = new NetAssign_(reg);
} else {
/* If the bit/part select is constant, then make the
NetAssign_ only as wide as it needs to be and connect
only to the selected bits of the reg. */
unsigned loff = reg->sb_to_idx(lsb);
unsigned moff = reg->sb_to_idx(msb);
unsigned wid = moff - loff + 1;
if (moff < loff) {
cerr << get_line() << ": error: part select "
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
<< " is reversed." << endl;
des->errors += 1;
return 0;
}
/* If the part select extends beyond the extreme of the
variable, then report an error. Note that loff is
converted to normalized form so is relative the
variable pins. */
if ((wid + loff) > reg->vector_width()) {
cerr << get_line() << ": error: bit/part select "
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
<< " is out of range." << endl;
des->errors += 1;
return 0;
}
lv = new NetAssign_(reg);
lv->set_part(new NetEConst(verinum(loff)), wid);
}
return lv;
}
NetAssign_* PEIdent::elaborate_lval_net_word_(Design*des,
NetScope*scope,
NetNet*reg) const
{
const name_component_t&name_tail = path_.back();
ivl_assert(*this, !name_tail.index.empty());
const index_component_t&index_head = name_tail.index.front();
ivl_assert(*this, index_head.sel == index_component_t::SEL_BIT);
ivl_assert(*this, index_head.msb != 0);
ivl_assert(*this, index_head.lsb == 0);
NetExpr*word = elab_and_eval(des, scope, index_head.msb, -1);
// If there is a non-zero base to the memory, then build an
// expression to calculate the canonical address.
if (long base = reg->array_first()) {
word = make_add_expr(word, 0-base);
if (NetExpr*tmp = word->eval_tree()) {
word = tmp;
}
}
NetAssign_*lv = new NetAssign_(reg);
lv->set_word(word);
if (debug_elaborate)
cerr << get_line() << ": debug: Set array word=" << *word << endl;
// Test for the case that the index is a constant, and is out
// of bounds. The "word" expression is the word index already
// converted to canonical address, so this just needs to check
// that the address is not too big.
if (NetEConst*word_const = dynamic_cast<NetEConst*>(word)) {
verinum word_val = word_const->value();
long index = word_val.as_long();
if (index < 0 || index >= reg->array_count()) {
cerr << get_line() << ": warning: Constant array index "
<< (index + reg->array_first())
<< " is out of range for array "
<< reg->name() << "." << endl;
}
}
/* An array word may also have part selects applied to them. */
index_component_t::ctype_t use_sel = index_component_t::SEL_NONE;
if (name_tail.index.size() > 1)
use_sel = name_tail.index.back().sel;
if (use_sel == index_component_t::SEL_PART)
elaborate_lval_net_part_(des, scope, lv);
if (use_sel == index_component_t::SEL_IDX_UP)
elaborate_lval_net_idx_up_(des, scope, lv);
if (use_sel == index_component_t::SEL_IDX_DO)
elaborate_lval_net_idx_do_(des, scope, lv);
return lv;
}
bool PEIdent::elaborate_lval_net_part_(Design*des,
NetScope*scope,
NetAssign_*lv) const
{
long msb, lsb;
bool flag = calculate_parts_(des, scope, msb, lsb);
if (!flag)
return false;
NetNet*reg = lv->sig();
assert(reg);
if (msb == reg->msb() && lsb == reg->lsb()) {
/* No bit select, and part select covers the entire
vector. Simplest case. */
} else {
/* If the bit/part select is constant, then make the
NetAssign_ only as wide as it needs to be and connect
only to the selected bits of the reg. */
unsigned loff = reg->sb_to_idx(lsb);
unsigned moff = reg->sb_to_idx(msb);
unsigned wid = moff - loff + 1;
if (moff < loff) {
cerr << get_line() << ": error: part select "
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
<< " is reversed." << endl;
des->errors += 1;
return false;
}
/* If the part select extends beyond the extreme of the
variable, then report an error. Note that loff is
converted to normalized form so is relative the
variable pins. */
if ((wid + loff) > reg->vector_width()) {
cerr << get_line() << ": error: bit/part select "
<< reg->name() << "[" << msb<<":"<<lsb<<"]"
<< " is out of range." << endl;
des->errors += 1;
return false;
}
lv->set_part(new NetEConst(verinum(loff)), wid);
}
return true;
}
bool PEIdent::elaborate_lval_net_idx_up_(Design*des,
NetScope*scope,
NetAssign_*lv) const
{
const name_component_t&name_tail = path_.back();;
ivl_assert(*this, !name_tail.index.empty());
const index_component_t&index_tail = name_tail.index.back();
ivl_assert(*this, index_tail.msb != 0);
ivl_assert(*this, index_tail.lsb != 0);
NetNet*reg = lv->sig();
assert(reg);
if (reg->type() != NetNet::REG) {
cerr << get_line() << ": error: " << path_ <<
" is not a reg/integer/time in " << scope_path(scope) <<
"." << endl;
cerr << reg->get_line() << ": : " << path_ <<
" is declared here as " << reg->type() << "." << endl;
des->errors += 1;
return false;
}
unsigned long wid;
calculate_up_do_width_(des, scope, wid);
NetExpr*base = elab_and_eval(des, scope, index_tail.msb, -1);
/* Correct the mux for the range of the vector. */
if (reg->msb() < reg->lsb())
base = make_sub_expr(reg->lsb(), base);
else if (reg->lsb() != 0)
base = make_add_expr(base, - reg->lsb());
if (debug_elaborate)
cerr << get_line() << ": debug: Set part select width="
<< wid << ", base=" << *base << endl;
lv->set_part(base, wid);
return true;
}
bool PEIdent::elaborate_lval_net_idx_do_(Design*des,
NetScope*scope,
NetAssign_*lv) const
{
const name_component_t&name_tail = path_.back();;
ivl_assert(*this, !name_tail.index.empty());
const index_component_t&index_tail = name_tail.index.back();
ivl_assert(*this, index_tail.msb != 0);
ivl_assert(*this, index_tail.lsb != 0);
cerr << get_line() << ": internal error: don't know how to "
"deal with SEL_IDX_DO in lval?" << endl;
des->errors += 1;
return false;
}
NetAssign_* PENumber::elaborate_lval(Design*des, NetScope*, bool) const
{
cerr << get_line() << ": error: Constant values not allowed "
<< "in l-value expressions." << endl;
des->errors += 1;
return 0;
}
/*
* $Log: elab_lval.cc,v $
* Revision 1.44 2007/06/02 03:42:12 steve
* Properly evaluate scope path expressions.
*
* Revision 1.43 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.42 2007/03/14 05:06:49 steve
* Replace some asserts with ivl_asserts.
*
* Revision 1.41 2007/03/05 05:59:10 steve
* Handle processes within generate loops.
*
* Revision 1.40 2007/02/27 05:14:38 steve
* Detect and warn about lval array index out fo bounds.
*
* Revision 1.39 2007/02/01 05:25:26 steve
* Error message better reflects more general reality.
*
* Revision 1.38 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory
* classes are removed from the ivl core program, and the IVL_LPM_RAM
* lpm type is removed from the ivl_target API.
*
* Revision 1.37 2006/11/04 06:19:25 steve
* Remove last bits of relax_width methods, and use test_width
* to calculate the width of an r-value expression that may
* contain unsized numbers.
*
* Revision 1.36 2006/06/02 04:48:50 steve
* Make elaborate_expr methods aware of the width that the context
* requires of it. In the process, fix sizing of the width of unary
* minus is context determined sizes.
*
* Revision 1.35 2006/04/16 00:54:04 steve
* Cleanup lval part select handling.
*
* Revision 1.34 2006/04/16 00:15:43 steve
* Fix part selects in l-values.
*
* Revision 1.33 2006/02/02 02:43:57 steve
* Allow part selects of memory words in l-values.
*
* Revision 1.32 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.31 2004/12/29 23:55:43 steve
* Unify elaboration of l-values for all proceedural assignments,
* including assing, cassign and force.
*
* Generate NetConcat devices for gate outputs that feed into a
* vector results. Use this to hande gate arrays. Also let gate
* arrays handle vectors of gates when the outputs allow for it.
*
* Revision 1.30 2004/12/11 02:31:25 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
* down this path.
*
* Revision 1.29 2004/10/04 01:10:52 steve
* Clean up spurious trailing white space.
*
* Revision 1.28 2004/08/28 14:59:44 steve
* More detailed error message about bad variable.
*
* Revision 1.27 2003/09/19 03:30:05 steve
* Fix name search in elab_lval.
*/
+2618 -902
View File
File diff suppressed because it is too large Load Diff
+238 -8
View File
@@ -16,11 +16,18 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_pexpr.cc,v 1.3 2000/03/12 18:22:11 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_pexpr.cc,v 1.28 2007/06/02 03:42:12 steve Exp $"
#endif
# include "config.h"
# include "PExpr.h"
# include "compiler.h"
# include "util.h"
# include "netmisc.h"
# include <iostream>
NetExpr*PExpr::elaborate_pexpr(Design*des, NetScope*sc) const
{
@@ -47,10 +54,75 @@ NetExpr*PEBinary::elaborate_pexpr (Design*des, NetScope*scope) const
return 0;
}
NetEBinary*tmp = elaborate_expr_base_(des, lp, rp);
NetEBinary*tmp = elaborate_expr_base_(des, lp, rp, -1);
return tmp;
}
/*
* Event though parameters are not generally sized, parameter
* expressions can include concatenation expressions. This requires
* that the subexpressions all have well-defined size (in spite of
* being in a parameter expression) in order to get a defined
* value. The sub-expressions themselves must also be value parameter
* expressions.
*/
NetEConcat* PEConcat::elaborate_pexpr(Design*des, NetScope*scope) const
{
NetExpr* repeat = 0;
/* If there is a repeat expression, then evaluate the constant
value and set the repeat count. */
if (repeat_) {
repeat = repeat_->elaborate_pexpr(des, scope);
if (repeat == 0) {
cerr << get_line() << ": error: "
"concatenation repeat expression cannot be evaluated."
<< endl;
des->errors += 1;
}
/* continue on even if the repeat expression doesn't
work, as we can find more errors. */
}
/* Make the empty concat expression. */
NetEConcat*tmp = new NetEConcat(parms_.count(), repeat);
tmp->set_line(*this);
/* Elaborate all the operands and attach them to the concat
node. Use the elaborate_pexpr method instead of the
elaborate_expr method. */
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
assert(parms_[idx]);
NetExpr*ex = parms_[idx]->elaborate_pexpr(des, scope);
if (ex == 0) continue;
ex->set_line(*parms_[idx]);
if (dynamic_cast<NetEParam*>(ex)) {
/* If this parameter is a NetEParam, then put off
the width check for later. */
} else if (! ex->has_width()) {
cerr << ex->get_line() << ": error: operand of "
<< "concatenation has indefinite width: "
<< *ex << endl;
des->errors += 1;
}
tmp->set(idx, ex);
}
return tmp;
}
NetExpr*PEFNumber::elaborate_pexpr(Design*des, NetScope*scope) const
{
return elaborate_expr(des, scope, -1, false);
}
/*
* Parameter expressions may reference other parameters, but only in
* the current scope. Preserve the parameter reference in the
@@ -59,16 +131,55 @@ NetExpr*PEBinary::elaborate_pexpr (Design*des, NetScope*scope) const
*/
NetExpr*PEIdent::elaborate_pexpr(Design*des, NetScope*scope) const
{
const NetExpr*ex = scope->get_parameter(text_);
pform_name_t path = path_;
name_component_t name_tail = path_.back();
path.pop_back();
NetScope*pscope = scope;
if (path_.size() > 0) {
list<hname_t> tmp = eval_scope_path(des, scope, path);
pscope = des->find_scope(scope, tmp);
}
const NetExpr*ex_msb;
const NetExpr*ex_lsb;
const NetExpr*ex = pscope->get_parameter(name_tail.name, ex_msb, ex_lsb);
if (ex == 0) {
cerr << get_line() << ": error: identifier ``" << text_ <<
"'' is not a parameter in " << scope->name() << "." << endl;
cerr << get_line() << ": error: identifier ``" << name_tail.name <<
"'' is not a parameter in "<< scope_path(scope)<< "." << endl;
des->errors += 1;
return 0;
}
NetExpr*res = new NetEParam(des, scope, text_);
NetExpr*res = new NetEParam(des, pscope, name_tail.name);
res->set_line(*this);
assert(res);
index_component_t::ctype_t use_sel = index_component_t::SEL_NONE;
if (!name_tail.index.empty())
use_sel = name_tail.index.back().sel;
switch (use_sel) {
case index_component_t::SEL_NONE:
break;
default:
case index_component_t::SEL_PART:
cerr << get_line() << ": sorry: Cannot part select "
"bits of parameters." << endl;
des->errors += 1;
break;
case index_component_t::SEL_BIT:
/* We have here a bit select. Insert a NetESelect node
to handle it. */
NetExpr*tmp = name_tail.index.back().msb->elaborate_pexpr(des, scope);
if (tmp != 0) {
res = new NetESelect(res, tmp, 1);
}
break;
}
return res;
}
@@ -77,10 +188,26 @@ NetExpr*PEIdent::elaborate_pexpr(Design*des, NetScope*scope) const
*/
NetExpr*PENumber::elaborate_pexpr(Design*des, NetScope*sc) const
{
return elaborate_expr(des, sc);
return elaborate_expr(des, sc, -1, false);
}
NetEConst* PEString::elaborate_pexpr(Design*des, NetScope*scope) const
{
return elaborate_expr(des, scope, -1, false);
}
NetETernary* PETernary::elaborate_pexpr(Design*des, NetScope*scope) const
{
NetExpr*c = expr_->elaborate_pexpr(des, scope);
NetExpr*t = tru_->elaborate_pexpr(des, scope);
NetExpr*f = fal_->elaborate_pexpr(des, scope);
if (c == 0) return 0;
if (t == 0) return 0;
if (f == 0) return 0;
return new NetETernary(c, t, f);
}
NetExpr*PEUnary::elaborate_pexpr (Design*des, NetScope*scope) const
{
NetExpr*ip = expr_->elaborate_pexpr(des, scope);
@@ -100,12 +227,115 @@ NetExpr*PEUnary::elaborate_pexpr (Design*des, NetScope*scope) const
tmp = new NetEUBits(op_, ip);
tmp->set_line(*this);
break;
case '!': // Logical NOT
case '&': // Reduction AND
case '|': // Reduction OR
case '^': // Reduction XOR
case 'A': // Reduction NAND (~&)
case 'N': // Reduction NOR (~|)
case 'X': // Reduction NXOR (~^)
tmp = new NetEUReduce(op_, ip);
tmp->set_line(*this);
break;
}
return tmp;
}
/*
* $Log: elab_pexpr.cc,v $
* Revision 1.28 2007/06/02 03:42:12 steve
* Properly evaluate scope path expressions.
*
* Revision 1.27 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.26 2007/04/26 03:06:22 steve
* Rework hname_t to use perm_strings.
*
* Revision 1.25 2006/11/04 06:19:25 steve
* Remove last bits of relax_width methods, and use test_width
* to calculate the width of an r-value expression that may
* contain unsized numbers.
*
* Revision 1.24 2006/06/02 04:48:50 steve
* Make elaborate_expr methods aware of the width that the context
* requires of it. In the process, fix sizing of the width of unary
* minus is context determined sizes.
*
* Revision 1.23 2006/02/02 02:43:58 steve
* Allow part selects of memory words in l-values.
*
* Revision 1.22 2005/11/27 05:56:20 steve
* Handle bit select of parameter with ranges.
*
* Revision 1.21 2004/02/20 06:22:56 steve
* parameter keys are per_strings.
*
* Revision 1.20 2003/05/30 02:55:32 steve
* Support parameters in real expressions and
* as real expressions, and fix multiply and
* divide with real results.
*
* Revision 1.19 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.18 2002/12/05 02:14:33 steve
* Support bit select in constant expressions.
*
* Revision 1.17 2002/11/09 01:40:19 steve
* Postpone parameter width check to evaluation.
*
* Revision 1.16 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
* Revision 1.15 2002/05/06 02:30:27 steve
* Allow parameters in concatenation of widths are defined.
*
* Revision 1.14 2002/05/05 21:11:50 steve
* Put off evaluation of concatenation repeat expresions
* until after parameters are defined. This allows parms
* to be used in repeat expresions.
*
* Add the builtin $signed system function.
*
* Revision 1.13 2002/01/28 00:52:41 steve
* Add support for bit select of parameters.
* This leads to a NetESelect node and the
* vvp code generator to support that.
*
* Revision 1.12 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.11 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
* Revision 1.10 2001/10/07 03:38:08 steve
* parameter names do not have defined size.
*
* Revision 1.9 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.8 2001/01/14 23:04:56 steve
* Generalize the evaluation of floating point delays, and
* get it working with delay assignment statements.
*
* Allow parameters to be referenced by hierarchical name.
*
* Revision 1.7 2001/01/02 04:21:13 steve
* Support a bunch of unary operators in parameter expressions.
*
* Revision 1.6 2000/12/16 19:03:30 steve
* Evaluate <= and ?: in parameter expressions (PR#81)
*
* Revision 1.5 2000/06/13 05:22:16 steve
* Support concatenation in parameter expressions.
*
* Revision 1.4 2000/06/01 02:31:39 steve
* Parameters can be strings.
*
* Revision 1.3 2000/03/12 18:22:11 steve
* Binary and unary operators in parameter expressions.
*
+521 -83
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2003 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,10 +16,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_scope.cc,v 1.4 2000/04/09 17:44:30 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_scope.cc,v 1.46 2007/06/02 03:42:12 steve Exp $"
#endif
# include "config.h"
# include "compiler.h"
# include "netmisc.h"
# include <iostream>
# include <stdio.h>
/*
* Elaboration happens in two passes, generally. The first scans the
* pform to generate the NetScope tree and attach it to the Design
@@ -31,13 +37,23 @@
# include "PEvent.h"
# include "PExpr.h"
# include "PGate.h"
# include "PGenerate.h"
# include "PTask.h"
# include "PWire.h"
# include "Statement.h"
# include "netlist.h"
# include "util.h"
# include <typeinfo>
# include <assert.h>
bool Module::elaborate_scope(Design*des, NetScope*scope) const
bool Module::elaborate_scope(Design*des, NetScope*scope,
const replace_t&replacements) const
{
if (debug_scopes) {
cerr << get_line() << ": debug: Elaborate scope "
<< scope_path(scope) << "." << endl;
}
// Generate all the parameters that this instance of this
// module introduces to the design. This loop elaborates the
// parameters, but doesn't evaluate references to
@@ -49,7 +65,8 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
// the pform and just place a NetEParam placeholder in the
// place of the elaborated expression.
typedef map<string,PExpr*>::const_iterator mparm_it_t;
typedef map<perm_string,param_expr_t>::const_iterator mparm_it_t;
typedef map<pform_name_t,PExpr*>::const_iterator pform_parm_it_t;
// This loop scans the parameters in the module, and creates
@@ -58,13 +75,22 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
for (mparm_it_t cur = parameters.begin()
; cur != parameters.end() ; cur ++) {
scope->set_parameter((*cur).first, new NetEParam);
NetEParam*tmp = new NetEParam;
tmp->set_line(*((*cur).second.expr));
tmp->cast_signed( (*cur).second.signed_flag );
scope->set_parameter((*cur).first, tmp, 0, 0, false);
}
for (mparm_it_t cur = localparams.begin()
; cur != localparams.end() ; cur ++) {
scope->set_parameter((*cur).first, new NetEParam);
NetEParam*tmp = new NetEParam;
tmp->set_line(*((*cur).second.expr));
if ((*cur).second.msb)
tmp->cast_signed( (*cur).second.signed_flag );
scope->set_parameter((*cur).first, tmp, 0, 0, false);
}
@@ -76,23 +102,90 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
for (mparm_it_t cur = parameters.begin()
; cur != parameters.end() ; cur ++) {
PExpr*ex = (*cur).second;
PExpr*ex = (*cur).second.expr;
assert(ex);
NetExpr*val = ex->elaborate_pexpr(des, scope);
val = scope->set_parameter((*cur).first, val);
NetExpr*msb = 0;
NetExpr*lsb = 0;
bool signed_flag = (*cur).second.signed_flag;
/* If the parameter declaration includes msb and lsb,
then use them to calculate a width for the
result. Then make sure the constant expression of the
parameter value is coerced to have the correct
and defined width. */
if ((*cur).second.msb) {
msb = (*cur).second.msb ->elaborate_pexpr(des, scope);
assert(msb);
lsb = (*cur).second.lsb ->elaborate_pexpr(des, scope);
}
if (signed_flag) {
/* If explicitly signed, then say so. */
val->cast_signed(true);
} else if ((*cur).second.msb) {
/* If there is a range, then the signedness comes
from the type and not the expression. */
val->cast_signed(signed_flag);
} else {
/* otherwise, let the expression describe
itself. */
signed_flag = val->has_sign();
}
val = scope->set_parameter((*cur).first, val,
msb, lsb, signed_flag);
assert(val);
delete val;
}
/* run parameter replacements that were collected from the
containing scope and meant for me. */
for (replace_t::const_iterator cur = replacements.begin()
; cur != replacements.end() ; cur ++) {
NetExpr*val = (*cur).second;
if (debug_scopes) {
cerr << get_line() << ": debug: "
<< "Replace " << (*cur).first
<< " with expression " << *val
<< " from " << val->get_line() << "." << endl;
}
bool flag = scope->replace_parameter((*cur).first, val);
if (! flag) {
cerr << val->get_line() << ": warning: parameter "
<< (*cur).first << " not found in "
<< scope_path(scope) << "." << endl;
}
}
for (mparm_it_t cur = localparams.begin()
; cur != localparams.end() ; cur ++) {
PExpr*ex = (*cur).second;
PExpr*ex = (*cur).second.expr;
assert(ex);
NetExpr*val = ex->elaborate_pexpr(des, scope);
val = scope->set_parameter((*cur).first, val);
NetExpr*msb = 0;
NetExpr*lsb = 0;
bool signed_flag = false;
/* If the parameter declaration includes msb and lsb,
then use them to calculate a width for the
result. Then make sure the constant expression of the
parameter value is coerced to have the correct
and defined width. */
if ((*cur).second.msb) {
msb = (*cur).second.msb ->elaborate_pexpr(des, scope);
assert(msb);
lsb = (*cur).second.lsb ->elaborate_pexpr(des, scope);
signed_flag = (*cur).second.signed_flag;
}
val->cast_signed(signed_flag);
val = scope->set_parameter((*cur).first, val,
msb, lsb, signed_flag);
assert(val);
delete val;
}
@@ -104,10 +197,10 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
// It is OK to elaborate the expressions of the defparam here
// because Verilog requires that the expressions only use
// local parameter names. It is *not* OK to do the override
// here becuase the parameter receiving the assignment may be
// here because the parameter receiving the assignment may be
// in a scope not discovered by this pass.
for (mparm_it_t cur = defparms.begin()
for (pform_parm_it_t cur = defparms.begin()
; cur != defparms.end() ; cur ++ ) {
PExpr*ex = (*cur).second;
@@ -118,18 +211,40 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
scope->defparams[(*cur).first] = val;
}
// Evaluate the attributes. Evaluate them in the scope of the
// module that the attribute is attached to. Is this correct?
unsigned nattr;
attrib_list_t*attr = evaluate_attributes(attributes, nattr, des, scope);
for (unsigned idx = 0 ; idx < nattr ; idx += 1)
scope->attribute(attr[idx].key, attr[idx].val);
delete[]attr;
// Generate schemes can create new scopes in the form of
// generated code. Scan the generate schemes, and *generate*
// new scopes, which is slightly different from simple
// elaboration.
typedef list<PGenerate*>::const_iterator generate_it_t;
for (generate_it_t cur = generate_schemes.begin()
; cur != generate_schemes.end() ; cur ++ ) {
(*cur) -> generate_scope(des, scope);
}
// Tasks introduce new scopes, so scan the tasks in this
// module. Create a scope for the task and pass that to the
// elaborate_scope method of the PTask for detailed
// processing.
typedef map<string,PTask*>::const_iterator tasks_it_t;
typedef map<perm_string,PTask*>::const_iterator tasks_it_t;
for (tasks_it_t cur = tasks_.begin()
; cur != tasks_.end() ; cur ++ ) {
NetScope*task_scope = new NetScope(scope, (*cur).first,
hname_t use_name( (*cur).first );
NetScope*task_scope = new NetScope(scope, use_name,
NetScope::TASK);
(*cur).second->elaborate_scope(des, task_scope);
}
@@ -139,12 +254,13 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
// perspective of scopes. So handle them exactly the same
// way.
typedef map<string,PFunction*>::const_iterator funcs_it_t;
typedef map<perm_string,PFunction*>::const_iterator funcs_it_t;
for (funcs_it_t cur = funcs_.begin()
; cur != funcs_.end() ; cur ++ ) {
NetScope*func_scope = new NetScope(scope, (*cur).first,
hname_t use_name( (*cur).first );
NetScope*func_scope = new NetScope(scope, use_name,
NetScope::FUNC);
(*cur).second->elaborate_scope(des, func_scope);
}
@@ -154,7 +270,6 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
// scan all of them to create those scopes.
typedef list<PGate*>::const_iterator gates_it_t;
for (gates_it_t cur = gates_.begin()
; cur != gates_.end() ; cur ++ ) {
@@ -175,11 +290,11 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
}
// Scan through all the named events in this scope. We do not
// need anything more then the current scope to do this
// need anything more than the current scope to do this
// elaboration, so do it now. This allows for normal
// elaboration to reference these events.
for (map<string,PEvent*>::const_iterator et = events.begin()
for (map<perm_string,PEvent*>::const_iterator et = events.begin()
; et != events.end() ; et ++ ) {
(*et).second->elaborate_scope(des, scope);
@@ -188,18 +303,133 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
return des->errors == 0;
}
bool PGenerate::generate_scope(Design*des, NetScope*container)
{
switch (scheme_type) {
case GS_LOOP:
return generate_scope_loop_(des, container);
default:
cerr << get_line() << ": sorry: Generate of this sort"
<< " is not supported yet!" << endl;
return false;
}
}
/*
* This is the elaborate scope method for a generate loop.
*/
bool PGenerate::generate_scope_loop_(Design*des, NetScope*container)
{
// We're going to need a genvar...
int genvar;
// The initial value for the genvar does not need (nor can it
// use) the genvar itself, so we can evaluate this expression
// the same way any other paramter value is evaluated.
NetExpr*init_ex = elab_and_eval(des, container, loop_init, -1);
NetEConst*init = dynamic_cast<NetEConst*> (init_ex);
if (init == 0) {
cerr << get_line() << ": error: Cannot evaluate genvar"
<< " init expression: " << *loop_init << endl;
des->errors += 1;
return false;
}
genvar = init->value().as_long();
delete init_ex;
if (debug_elaborate)
cerr << get_line() << ": debug: genvar init = " << genvar << endl;
container->genvar_tmp = loop_index;
container->genvar_tmp_val = 0;
NetExpr*test_ex = elab_and_eval(des, container, loop_test, -1);
NetEConst*test = dynamic_cast<NetEConst*>(test_ex);
assert(test);
while (test->value().as_long()) {
// The actual name of the scope includes the genvar so
// that each instance has a unique name in the
// container. The format of using [] is part of the
// Verilog standard.
hname_t use_name (scope_name, genvar);
if (debug_elaborate)
cerr << get_line() << ": debug: "
<< "Create generated scope " << use_name << endl;
NetScope*scope = new NetScope(container, use_name,
NetScope::GENBLOCK);
// Set in the scope a localparam for the value of the
// genvar within this instance of the generate
// block. Code within this scope thus has access to the
// genvar as a constant.
{
verinum genvar_verinum(genvar);
genvar_verinum.has_sign(true);
NetEConstParam*gp = new NetEConstParam(scope,
loop_index,
genvar_verinum);
scope->set_localparam(loop_index, gp);
if (debug_elaborate)
cerr << get_line() << ": debug: "
<< "Create implicit localparam "
<< loop_index << " = " << genvar_verinum << endl;
}
// Scan the generated scope for gates that may create
// their own scopes.
typedef list<PGate*>::const_iterator pgate_list_it_t;
for (pgate_list_it_t cur = gates.begin()
; cur != gates.end() ; cur ++) {
(*cur) ->elaborate_scope(des, scope);
}
scope_list_.push_back(scope);
// Calculate the step for the loop variable.
NetExpr*step_ex = elab_and_eval(des, container, loop_step, -1);
NetEConst*step = dynamic_cast<NetEConst*>(step_ex);
assert(step);
if (debug_elaborate)
cerr << get_line() << ": debug: genvar step from "
<< genvar << " to " << step->value().as_long() << endl;
genvar = step->value().as_long();
container->genvar_tmp_val = genvar;
delete step;
delete test_ex;
test_ex = elab_and_eval(des, container, loop_test, -1);
test = dynamic_cast<NetEConst*>(test_ex);
assert(test);
}
// Clear the genvar_tmp field in the scope to reflect that the
// genvar is no longer value for evaluating expressions.
container->genvar_tmp = perm_string();
return true;
}
void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
{
if (get_name() == "") {
cerr << get_line() << ": error: Instantiation of module "
<< mod->mod_name() << " requires an instance name." << endl;
des->errors += 1;
return;
}
// Missing module instance names have already been rejected.
assert(get_name() != "");
string path = sc->name();
// Check for duplicate scopes. Simply look up the scope I'm
// about to create, and if I find it then somebody beat me to
// it.
if (NetScope*tmp = des->find_scope(path + "." + get_name())) {
if (sc->child(hname_t(get_name()))) {
cerr << get_line() << ": error: Instance/Scope name " <<
get_name() << " already used in this context." <<
endl;
@@ -207,69 +437,172 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
return;
}
// Create the new scope as a MODULE with my name.
NetScope*my_scope = new NetScope(sc, get_name(), NetScope::MODULE);
// check for recursive instantiation by scanning the current
// scope and its parents. Look for a module instantiation of
// the same module, but farther up in the scope.
for (NetScope*scn = sc ; scn ; scn = scn->parent()) {
if (scn->type() != NetScope::MODULE)
continue;
// This call actually arranges for the description of the
// module type to process this instance and handle parameters
// and sub-scopes that might occur. Parameters are also
// created in that scope, as they exist. (I'll override them
// later.)
mod->elaborate_scope(des, my_scope);
if (strcmp(mod->mod_name(), scn->module_name()) != 0)
continue;
// Look for module parameter replacements. This map receives
// those replacements.
cerr << get_line() << ": error: You cannot instantiate "
<< "module " << mod->mod_name() << " within itself." << endl;
typedef map<string,PExpr*>::const_iterator mparm_it_t;
map<string,PExpr*> replace;
cerr << get_line() << ": : The offending instance is "
<< scope_path(sc) << "." << get_name() << " within "
<< scope_path(scn) << "." << endl;
des->errors += 1;
return;
}
// Positional parameter overrides are matched to parameter
// names by using the param_names list of parameter
// names. This is an ordered list of names so the first name
// is parameter 0, the second parameter 1, and so on.
NetExpr*mse = msb_ ? elab_and_eval(des, sc, msb_, -1) : 0;
NetExpr*lse = lsb_ ? elab_and_eval(des, sc, lsb_, -1) : 0;
NetEConst*msb = dynamic_cast<NetEConst*> (mse);
NetEConst*lsb = dynamic_cast<NetEConst*> (lse);
if (overrides_) {
assert(parms_ == 0);
list<string>::const_iterator cur = mod->param_names.begin();
for (unsigned idx = 0
; idx < overrides_->count()
; idx += 1, cur++) {
replace[*cur] = (*overrides_)[idx];
assert( (msb == 0) || (lsb != 0) );
long instance_low = 0;
long instance_high = 0;
long instance_count = 1;
bool instance_array = false;
if (msb) {
instance_array = true;
instance_high = msb->value().as_long();
instance_low = lsb->value().as_long();
if (instance_high > instance_low)
instance_count = instance_high - instance_low + 1;
else
instance_count = instance_low - instance_high + 1;
delete mse;
delete lse;
}
NetScope::scope_vec_t instances (instance_count);
if (debug_scopes) {
cerr << get_line() << ": debug: Create " << instance_count
<< " instances of " << get_name()
<< "." << endl;
}
// Run through the module instances, and make scopes out of
// them. Also do parameter overrides that are done on the
// instantiation line.
for (int idx = 0 ; idx < instance_count ; idx += 1) {
hname_t use_name (get_name());
if (instance_array) {
int instance_idx = idx;
if (instance_low < instance_high)
instance_idx = instance_low + idx;
else
instance_idx = instance_low - idx;
use_name = hname_t(get_name(), instance_idx);
}
}
if (debug_scopes) {
cerr << get_line() << ": debug: Module instance " << use_name
<< " becomes child of " << scope_path(sc)
<< "." << endl;
}
// Named parameter overrides carry a name with each override
// so the mapping into the replace list is much easier.
if (parms_) {
assert(overrides_ == 0);
for (unsigned idx = 0 ; idx < nparms_ ; idx += 1)
replace[parms_[idx].name] = parms_[idx].parm;
// Create the new scope as a MODULE with my name.
NetScope*my_scope = new NetScope(sc, use_name, NetScope::MODULE);
my_scope->set_module_name(mod->mod_name());
my_scope->default_nettype(mod->default_nettype);
instances[idx] = my_scope;
// Set time units and precision.
my_scope->time_unit(mod->time_unit);
my_scope->time_precision(mod->time_precision);
des->set_precision(mod->time_precision);
// Look for module parameter replacements. The "replace" map
// maps parameter name to replacement expression that is
// passed. It is built up by the ordered overrides or named
// overrides.
typedef map<perm_string,PExpr*>::const_iterator mparm_it_t;
map<perm_string,PExpr*> replace;
// Positional parameter overrides are matched to parameter
// names by using the param_names list of parameter
// names. This is an ordered list of names so the first name
// is parameter 0, the second parameter 1, and so on.
if (overrides_) {
assert(parms_ == 0);
list<perm_string>::const_iterator cur
= mod->param_names.begin();
unsigned idx = 0;
for (;;) {
if (idx >= overrides_->count())
break;
if (cur == mod->param_names.end())
break;
replace[*cur] = (*overrides_)[idx];
idx += 1;
cur ++;
}
}
// Named parameter overrides carry a name with each override
// so the mapping into the replace list is much easier.
if (parms_) {
assert(overrides_ == 0);
for (unsigned idx = 0 ; idx < nparms_ ; idx += 1)
replace[parms_[idx].name] = parms_[idx].parm;
}
Module::replace_t replace_net;
// And here we scan the replacements we collected. Elaborate
// the expression in my context, then replace the sub-scope
// parameter value with the new expression.
for (mparm_it_t cur = replace.begin()
; cur != replace.end() ; cur ++ ) {
PExpr*tmp = (*cur).second;
NetExpr*val = tmp->elaborate_pexpr(des, sc);
replace_net[(*cur).first] = val;
}
// This call actually arranges for the description of the
// module type to process this instance and handle parameters
// and sub-scopes that might occur. Parameters are also
// created in that scope, as they exist. (I'll override them
// later.)
mod->elaborate_scope(des, my_scope, replace_net);
}
// And here we scan the replacements we collected. Elaborate
// the expression in my context, then replace the sub-scope
// parameter value with the new expression.
for (mparm_it_t cur = replace.begin()
; cur != replace.end() ; cur ++ ) {
PExpr*tmp = (*cur).second;
NetExpr*val = tmp->elaborate_pexpr(des, sc);
val = my_scope->set_parameter((*cur).first, val);
assert(val);
delete val;
}
/* Stash the instance array of scopes into the parent
scope. Later elaboration passes will use this vector to
further elaborate the array. */
sc->instance_arrays[get_name()] = instances;
}
/*
* The isn't really able to create new scopes, but it does create the
* event name in the current scope, so can be done during the
* elaborate_scope scan.
* elaborate_scope scan. Note that the name_ of the PEvent object has
* no hierarchy, but neither does the NetEvent, until it is stored in
* the NetScope object.
*/
void PEvent::elaborate_scope(Design*des, NetScope*scope) const
{
@@ -280,10 +613,18 @@ void PEvent::elaborate_scope(Design*des, NetScope*scope) const
void PFunction::elaborate_scope(Design*des, NetScope*scope) const
{
assert(scope->type() == NetScope::FUNC);
if (statement_)
statement_->elaborate_scope(des, scope);
}
void PTask::elaborate_scope(Design*des, NetScope*scope) const
{
assert(scope->type() == NetScope::TASK);
if (statement_)
statement_->elaborate_scope(des, scope);
}
@@ -305,8 +646,8 @@ void PBlock::elaborate_scope(Design*des, NetScope*scope) const
{
NetScope*my_scope = scope;
if (name_ != "") {
my_scope = new NetScope(scope, name_, bl_type_==BL_PAR
if (name_ != 0) {
my_scope = new NetScope(scope, hname_t(name_), bl_type_==BL_PAR
? NetScope::FORK_JOIN
: NetScope::BEGIN_END);
}
@@ -317,7 +658,7 @@ void PBlock::elaborate_scope(Design*des, NetScope*scope) const
}
/*
* The case statement itseof does not introduce scope, but contains
* The case statement itself does not introduce scope, but contains
* other statements that may be named blocks. So scan the case items
* with the elaborate_scope method.
*/
@@ -415,21 +756,118 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
/*
* $Log: elab_scope.cc,v $
* Revision 1.4 2000/04/09 17:44:30 steve
* Catch event declarations during scope elaborate.
* Revision 1.46 2007/06/02 03:42:12 steve
* Properly evaluate scope path expressions.
*
* Revision 1.3 2000/03/12 17:09:41 steve
* Support localparam.
* Revision 1.45 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.2 2000/03/11 03:25:52 steve
* Locate scopes in statements.
* Revision 1.44 2007/03/22 16:08:15 steve
* Spelling fixes from Larry
*
* Revision 1.1 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
* in a separate pass over the pform. Once the scopes
* are generated, I can process overrides and evalutate
* paremeters before elaboration begins.
* Revision 1.43 2007/03/08 06:11:35 steve
* Elaborate scopes of modules instantated in generate loops.
*
* Revision 1.42 2007/03/05 05:59:10 steve
* Handle processes within generate loops.
*
* Revision 1.41 2006/06/02 04:48:50 steve
* Make elaborate_expr methods aware of the width that the context
* requires of it. In the process, fix sizing of the width of unary
* minus is context determined sizes.
*
* Revision 1.40 2006/04/12 05:05:03 steve
* Use elab_and_eval to evaluate genvar expressions.
*
* Revision 1.39 2006/04/10 00:37:42 steve
* Add support for generate loops w/ wires and gates.
*
* Revision 1.38 2006/03/30 01:49:07 steve
* Fix instance arrays indexed by overridden parameters.
*
* Revision 1.37 2006/03/18 22:53:38 steve
* Support more parameter syntax.
*
* Revision 1.36 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.35 2004/09/10 00:15:17 steve
* Missing stdio.h header for warnings.
*
* Revision 1.34 2004/09/05 17:44:41 steve
* Add support for module instance arrays.
*
* Revision 1.33 2004/08/26 04:02:03 steve
* Add support for localparam ranges.
*
* Revision 1.32 2004/06/13 04:56:54 steve
* Add support for the default_nettype directive.
*
* Revision 1.31 2004/05/25 19:21:06 steve
* More identifier lists use perm_strings.
*
* Revision 1.30 2004/02/20 06:22:56 steve
* parameter keys are per_strings.
*
* Revision 1.29 2004/02/19 07:06:57 steve
* LPM, logic and Variables have perm_string names.
*
* Revision 1.28 2004/02/18 17:11:55 steve
* Use perm_strings for named langiage items.
*
* Revision 1.27 2003/09/13 01:01:51 steve
* Spelling fixes.
*
* Revision 1.26 2003/08/28 04:11:17 steve
* Spelling patch.
*
* Revision 1.25 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.24 2003/06/20 00:53:19 steve
* Module attributes from the parser
* through to elaborated form.
*
* Revision 1.23 2003/06/16 00:34:08 steve
* Functions can have sub-scope.
*
* Revision 1.22 2003/06/13 19:10:46 steve
* Properly manage real variables in subscopes.
*
* Revision 1.21 2003/05/30 02:55:32 steve
* Support parameters in real expressions and
* as real expressions, and fix multiply and
* divide with real results.
*
* Revision 1.20 2003/03/06 00:28:41 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.19 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.18 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
*
* Revision 1.17 2002/10/19 22:59:49 steve
* Redo the parameter vector support to allow
* parameter names in range expressions.
*
* Revision 1.16 2002/09/01 03:01:48 steve
* Properly cast signedness of parameters with ranges.
*
* Revision 1.15 2002/08/19 02:39:16 steve
* Support parameters with defined ranges.
*
* Revision 1.14 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
* Revision 1.13 2001/12/30 04:47:57 steve
* Properly handle empty target in positionla parameter override.
*
* Revision 1.12 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*/
+912
View File
@@ -0,0 +1,912 @@
/*
* Copyright (c) 2000-2004 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_sig.cc,v 1.52 2007/06/02 03:42:12 steve Exp $"
#endif
# include "config.h"
# include <iostream>
# include "Module.h"
# include "PExpr.h"
# include "PGate.h"
# include "PGenerate.h"
# include "PTask.h"
# include "PWire.h"
# include "compiler.h"
# include "netlist.h"
# include "netmisc.h"
# include "util.h"
# include "ivl_assert.h"
/*
* This local function checks if a named signal is connected to a
* port. It looks in the array of ports passed, for NetEIdent objects
* within the port_t that have a matching name.
*/
static bool signal_is_in_port(const svector<Module::port_t*>&ports,
NetNet*sig)
{
perm_string name = sig->name();
for (unsigned idx = 0 ; idx < ports.count() ; idx += 1) {
Module::port_t*pp = ports[idx];
// Skip internally unconnected ports.
if (pp == 0)
continue;
// This port has an internal connection. In this case,
// the port has 0 or more NetEIdent objects concatenated
// together that form the port.
// Note that module ports should not have any heirarchy
// in their names: they are in the root of the module
// scope by definition.
for (unsigned cc = 0 ; cc < pp->expr.count() ; cc += 1) {
perm_string pname = peek_tail_name(pp->expr[cc]->path());
assert(pp->expr[cc]);
if (pname == name)
return true;
}
}
return false;
}
#if 0
static NetNet*find_signal_in_scope(NetScope*scope, const hname_t&path)
{
NetScope*cur = scope;
unsigned idx = 0;
while (path.peek_name(idx+1)) {
cur = cur->child(path.peek_name(idx));
if (cur == 0)
return 0;
idx += 1;
}
return cur->find_signal(path.peek_name(idx));
}
#endif
bool Module::elaborate_sig(Design*des, NetScope*scope) const
{
bool flag = true;
// Scan all the ports of the module, and make sure that each
// is connected to wires that have port declarations.
for (unsigned idx = 0 ; idx < ports.count() ; idx += 1) {
Module::port_t*pp = ports[idx];
if (pp == 0)
continue;
map<pform_name_t,PWire*>::const_iterator wt;
for (unsigned cc = 0 ; cc < pp->expr.count() ; cc += 1) {
pform_name_t port_path (pp->expr[cc]->path());
wt = wires_.find(port_path);
if (wt == wires_.end()) {
cerr << get_line() << ": error: "
<< "Port " << pp->expr[cc]->path() << " ("
<< (idx+1) << ") of module " << name_
<< " is not declared within module." << endl;
des->errors += 1;
continue;
}
if ((*wt).second->get_port_type() == NetNet::NOT_A_PORT) {
cerr << get_line() << ": error: "
<< "Port " << pp->expr[cc]->path() << " ("
<< (idx+1) << ") of module " << name_
<< " has no direction declaration."
<< endl;
des->errors += 1;
}
}
}
for (map<pform_name_t,PWire*>::const_iterator wt = wires_.begin()
; wt != wires_.end() ; wt ++ ) {
PWire*cur = (*wt).second;
NetNet*sig = cur->elaborate_sig(des, scope);
// If this wire is a signal of the module (as opposed to
// a port of a function) and is a port, then check that
// the module knows about it. We know that the signal is
// the name of a signal within a subscope of a module
// (a task, a function, etc.) if the name for the PWire
// has hierarchy.
if (sig && (sig->scope() == scope)
&& (cur->get_port_type() != NetNet::NOT_A_PORT)) {
if (! signal_is_in_port(ports, sig)) {
cerr << cur->get_line() << ": error: Signal "
<< sig->name() << " has a declared direction "
<< "but is not a port." << endl;
des->errors += 1;
}
}
/* If the signal is an input and is also declared as a
reg, then report an error. */
if (sig && (sig->scope() == scope)
&& (sig->port_type() == NetNet::PINPUT)
&& (sig->type() == NetNet::REG)) {
cerr << cur->get_line() << ": error: "
<< cur->path() << " in module "
<< scope->module_name()
<< " declared as input and as a reg type." << endl;
des->errors += 1;
}
if (sig && (sig->scope() == scope)
&& (sig->port_type() == NetNet::PINOUT)
&& (sig->type() == NetNet::REG)) {
cerr << cur->get_line() << ": error: "
<< cur->path() << " in module "
<< scope->module_name()
<< " declared as inout and as a reg type." << endl;
des->errors += 1;
}
}
// Run through all the generate schemes to enaborate the
// signals that they hold. Note that the generate schemes hold
// the scopes that they instantiated, so we don't pass any
// scope in.
typedef list<PGenerate*>::const_iterator generate_it_t;
for (generate_it_t cur = generate_schemes.begin()
; cur != generate_schemes.end() ; cur ++ ) {
(*cur) -> elaborate_sig(des);
}
// Get all the gates of the module and elaborate them by
// connecting them to the signals. The gate may be simple or
// complex. What we are looking for is gates that are modules
// that can create scopes and signals.
const list<PGate*>&gl = get_gates();
for (list<PGate*>::const_iterator gt = gl.begin()
; gt != gl.end()
; gt ++ ) {
flag &= (*gt)->elaborate_sig(des, scope);
}
typedef map<perm_string,PFunction*>::const_iterator mfunc_it_t;
for (mfunc_it_t cur = funcs_.begin()
; cur != funcs_.end() ; cur ++) {
hname_t use_name ( (*cur).first );
NetScope*fscope = scope->child(use_name);
if (scope == 0) {
cerr << (*cur).second->get_line() << ": internal error: "
<< "Child scope for function " << (*cur).first
<< " missing in " << scope_path(scope) << "." << endl;
des->errors += 1;
continue;
}
(*cur).second->elaborate_sig(des, fscope);
}
// After all the wires are elaborated, we are free to
// elaborate the ports of the tasks defined within this
// module. Run through them now.
typedef map<perm_string,PTask*>::const_iterator mtask_it_t;
for (mtask_it_t cur = tasks_.begin()
; cur != tasks_.end() ; cur ++) {
NetScope*tscope = scope->child( hname_t((*cur).first) );
assert(tscope);
(*cur).second->elaborate_sig(des, tscope);
}
return flag;
}
bool PGModule::elaborate_sig_mod_(Design*des, NetScope*scope,
Module*rmod) const
{
bool flag = true;
NetScope::scope_vec_t instance = scope->instance_arrays[get_name()];
for (unsigned idx = 0 ; idx < instance.count() ; idx += 1) {
// I know a priori that the elaborate_scope created the scope
// already, so just look it up as a child of the current scope.
NetScope*my_scope = instance[idx];
assert(my_scope);
if (my_scope->parent() != scope) {
cerr << get_line() << ": internal error: "
<< "Instance " << scope_path(my_scope)
<< " is in parent " << scope_path(my_scope->parent())
<< " instead of " << scope_path(scope)
<< endl;
}
assert(my_scope->parent() == scope);
if (! rmod->elaborate_sig(des, my_scope))
flag = false;
}
return flag;
}
bool PGenerate::elaborate_sig(Design*des) const
{
bool flag = true;
typedef list<NetScope*>::const_iterator scope_list_it_t;
for (scope_list_it_t cur = scope_list_.begin()
; cur != scope_list_.end() ; cur ++ ) {
if (debug_elaborate)
cerr << get_line() << ": debug: Elaborate nets in "
<< "scope " << scope_path(*cur) << endl;
flag = elaborate_sig_(des, *cur) & flag;
}
return flag;
}
bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const
{
// Scan the declared PWires to elaborate the obvious signals
// in the current scope.
typedef map<pform_name_t,PWire*>::const_iterator wires_it_t;
for (wires_it_t wt = wires.begin()
; wt != wires.end() ; wt ++ ) {
PWire*cur = (*wt).second;
if (debug_elaborate)
cerr << get_line() << ": debug: Elaborate PWire "
<< cur->path() << " in scope " << scope_path(scope) << endl;
cur->elaborate_sig(des, scope);
}
typedef list<PGate*>::const_iterator pgate_list_it_t;
for (pgate_list_it_t cur = gates.begin()
; cur != gates.end() ; cur ++) {
(*cur) ->elaborate_sig(des, scope);
}
return true;
}
/*
* A function definition exists within an elaborated module. This
* matters when elaborating signals, as the ports of the function are
* created as signals/variables for each instance of the
* function. That is why PFunction has an elaborate_sig method.
*/
void PFunction::elaborate_sig(Design*des, NetScope*scope) const
{
perm_string fname = scope->basename();
assert(scope->type() == NetScope::FUNC);
/* Make sure the function has at least one input port. If it
fails this test, print an error message. Keep going so we
can find more errors. */
if (ports_ == 0) {
cerr << get_line() << ": error: Function " << fname
<< " has no ports." << endl;
cerr << get_line() << ": : Functions must have"
<< " at least one input port." << endl;
des->errors += 1;
}
NetNet*ret_sig = 0;
/* Create the signals/variables of the return value and write
them into the function scope. */
switch (return_type_.type) {
case PTF_REG:
case PTF_REG_S:
if (return_type_.range) {
NetExpr*me = elab_and_eval(des, scope,
(*return_type_.range)[0], -1);
assert(me);
NetExpr*le = elab_and_eval(des, scope,
(*return_type_.range)[1], -1);
assert(le);
long mnum = 0, lnum = 0;
if (NetEConst*tmp = dynamic_cast<NetEConst*>(me)) {
mnum = tmp->value().as_long();
} else {
cerr << me->get_line() << ": error: "
"Unable to evaluate constant expression "
<< *me << "." << endl;
des->errors += 1;
}
if (NetEConst*tmp = dynamic_cast<NetEConst*>(le)) {
lnum = tmp->value().as_long();
} else {
cerr << le->get_line() << ": error: "
"Unable to evaluate constant expression "
<< *le << "." << endl;
des->errors += 1;
}
ret_sig = new NetNet(scope, fname, NetNet::REG, mnum, lnum);
} else {
ret_sig = new NetNet(scope, fname, NetNet::REG);
}
ret_sig->set_line(*this);
ret_sig->set_signed(return_type_.type == PTF_REG_S);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_LOGIC);
break;
case PTF_INTEGER:
ret_sig = new NetNet(scope, fname, NetNet::REG, integer_width);
ret_sig->set_line(*this);
ret_sig->set_signed(true);
ret_sig->set_isint(true);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_LOGIC);
break;
case PTF_TIME:
ret_sig = new NetNet(scope, fname, NetNet::REG, 64);
ret_sig->set_line(*this);
ret_sig->set_signed(false);
ret_sig->set_isint(false);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_LOGIC);
break;
case PTF_REAL:
case PTF_REALTIME:
ret_sig = new NetNet(scope, fname, NetNet::REG, 1);
ret_sig->set_line(*this);
ret_sig->set_signed(true);
ret_sig->set_isint(false);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_REAL);
break;
default:
cerr << get_line() << ": internal error: I don't know how "
<< "to deal with return type of function "
<< scope->basename() << "." << endl;
}
svector<NetNet*>ports (ports_? ports_->count() : 0);
if (ports_)
for (unsigned idx = 0 ; idx < ports_->count() ; idx += 1) {
/* Parse the port name into the task name and the reg
name. We know by design that the port name is given
as two components: <func>.<port>. */
pform_name_t path = (*ports_)[idx]->path();
ivl_assert(*this, path.size() == 2);
perm_string pname = peek_tail_name(path);
perm_string ppath = peek_head_name(path);
if (ppath != scope->basename()) {
cerr << get_line() << ": internal error: function "
<< "port " << (*ports_)[idx]->path()
<< " has wrong name for function "
<< scope_path(scope) << "." << endl;
des->errors += 1;
}
NetNet*tmp = scope->find_signal(pname);
if (tmp == 0) {
cerr << get_line() << ": internal error: function "
<< scope_path(scope) << " is missing port "
<< pname << "." << endl;
scope->dump(cerr);
cerr << get_line() << ": Continuing..." << endl;
des->errors += 1;
}
ports[idx] = tmp;
}
NetFuncDef*def = 0;
if (ret_sig) def = new NetFuncDef(scope, ret_sig, ports);
assert(def);
scope->set_func_def(def);
}
/*
* A task definition is a scope within an elaborated module. When we
* are elaborating signals, the scopes have already been created, as
* have the reg objects that are the parameters of this task. The
* elaborate_sig method of PTask is therefore left to connect the
* signals to the ports of the NetTaskDef definition. We know for
* certain that signals exist (They are in my scope!) so the port
* binding is sure to work.
*/
void PTask::elaborate_sig(Design*des, NetScope*scope) const
{
assert(scope->type() == NetScope::TASK);
svector<NetNet*>ports (ports_? ports_->count() : 0);
for (unsigned idx = 0 ; idx < ports.count() ; idx += 1) {
/* Parse the port name into the task name and the reg
name. We know by design that the port name is given
as two components: <task>.<port>. */
pform_name_t path = (*ports_)[idx]->path();
ivl_assert(*this, path.size() == 2);
perm_string scope_name = peek_head_name(path);
perm_string port_name = peek_tail_name(path);
/* check that the current scope really does have the
name of the first component of the task port name. Do
this by looking up the task scope in the parent of
the current scope. */
ivl_assert(*this, scope->basename() == scope_name);
/* Find the signal for the port. We know by definition
that it is in the scope of the task, so look only in
the scope. */
NetNet*tmp = scope->find_signal(port_name);
if (tmp == 0) {
cerr << get_line() << ": internal error: "
<< "Could not find port " << port_name
<< " in scope " << scope_path(scope) << endl;
scope->dump(cerr);
}
ports[idx] = tmp;
}
NetTaskDef*def = new NetTaskDef(scope, ports);
scope->set_task_def(def);
}
bool PGate::elaborate_sig(Design*des, NetScope*scope) const
{
return true;
}
/*
* Elaborate a source wire. The "wire" is the declaration of wires,
* registers, ports and memories. The parser has already merged the
* multiple properties of a wire (i.e., "input wire") so come the
* elaboration this creates an object in the design that represent the
* defined item.
*/
NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
{
/* The parser may produce hierarchical names for wires. I here
follow the scopes down to the base where I actually want to
elaborate the NetNet object. */
{ pform_name_t tmp_path = hname_;
tmp_path.pop_back();
while (! tmp_path.empty()) {
name_component_t cur = tmp_path.front();
tmp_path.pop_front();
scope = scope->child( hname_t(cur.name) );
if (scope == 0) {
cerr << get_line() << ": internal error: "
<< "Bad scope component for name "
<< hname_ << endl;
assert(scope);
}
}
}
NetNet::Type wtype = type_;
if (wtype == NetNet::IMPLICIT)
wtype = NetNet::WIRE;
if (wtype == NetNet::IMPLICIT_REG)
wtype = NetNet::REG;
unsigned wid = 1;
long lsb = 0, msb = 0;
assert(msb_.count() == lsb_.count());
if (msb_.count()) {
svector<long>mnum (msb_.count());
svector<long>lnum (msb_.count());
/* There may be places where the signal is declared as a
scalar. Count those here, for consistency check
later. */
unsigned count_scalars = 0;
/* There may be multiple declarations of ranges, because
the symbol may have its range declared in e.g., input
and reg declarations. Calculate *all* the numbers
here. I will resolve the values later. */
for (unsigned idx = 0 ; idx < msb_.count() ; idx += 1) {
if (msb_[idx] == 0) {
count_scalars += 1;
assert(lsb_[idx] == 0);
mnum[idx] = 0;
lnum[idx] = 0;
continue;
}
NetEConst*tmp;
NetExpr*texpr = elab_and_eval(des, scope, msb_[idx], -1);
tmp = dynamic_cast<NetEConst*>(texpr);
if (tmp == 0) {
cerr << msb_[idx]->get_line() << ": error: "
"Unable to evaluate constant expression ``" <<
*msb_[idx] << "''." << endl;
des->errors += 1;
return 0;
}
mnum[idx] = tmp->value().as_long();
delete texpr;
texpr = elab_and_eval(des, scope, lsb_[idx], -1);
tmp = dynamic_cast<NetEConst*>(texpr);
if (tmp == 0) {
cerr << msb_[idx]->get_line() << ": error: "
"Unable to evaluate constant expression ``" <<
*lsb_[idx] << "''." << endl;
des->errors += 1;
return 0;
}
lnum[idx] = tmp->value().as_long();
delete texpr;
}
/* Check that the declarations were all scalar or all
vector. It is an error to mix them. Use the
count_scalars to know. */
if ((count_scalars > 0) && (count_scalars != msb_.count())) {
cerr << get_line() << ": error: Signal ``" << hname_
<< "'' declared both as a vector and a scalar."
<< endl;
des->errors += 1;
return 0;
}
/* Make sure all the values for msb and lsb match by
value. If not, report an error. */
for (unsigned idx = 1 ; idx < msb_.count() ; idx += 1) {
if ((mnum[idx] != mnum[0]) || (lnum[idx] != lnum[0])) {
cerr << get_line() << ": error: Inconsistent width, "
"[" << mnum[idx] << ":" << lnum[idx] << "]"
" vs. [" << mnum[0] << ":" << lnum[0] << "]"
" for signal ``" << hname_ << "''" << endl;
des->errors += 1;
return 0;
}
}
lsb = lnum[0];
msb = mnum[0];
if (mnum[0] > lnum[0])
wid = mnum[0] - lnum[0] + 1;
else
wid = lnum[0] - mnum[0] + 1;
}
unsigned nattrib = 0;
attrib_list_t*attrib_list = evaluate_attributes(attributes, nattrib,
des, scope);
long array_s0 = 0;
long array_e0 = 0;
unsigned array_dimensions = 0;
/* If the ident has idx expressions, then this is a
memory. It can only have the idx registers after the msb
and lsb expressions are filled. And, if it has one index,
it has both. */
if (lidx_ || ridx_) {
assert(lidx_ && ridx_);
NetExpr*lexp = elab_and_eval(des, scope, lidx_, -1);
NetExpr*rexp = elab_and_eval(des, scope, ridx_, -1);
if ((lexp == 0) || (rexp == 0)) {
cerr << get_line() << ": internal error: There is "
<< "a problem evaluating indices for ``"
<< hname_ << "''." << endl;
des->errors += 1;
return 0;
}
NetEConst*lcon = dynamic_cast<NetEConst*> (lexp);
NetEConst*rcon = dynamic_cast<NetEConst*> (rexp);
if ((lcon == 0) || (rcon == 0)) {
cerr << get_line() << ": internal error: The indices "
<< "are not constant for array ``"
<< hname_ << "''." << endl;
des->errors += 1;
return 0;
}
verinum lval = lcon->value();
verinum rval = rcon->value();
delete lexp;
delete rexp;
array_dimensions = 1;
array_s0 = lval.as_long();
array_e0 = rval.as_long();
}
/* If the net type is supply0 or supply1, replace it
with a simple wire with a pulldown/pullup with supply
strength. In other words, transform:
supply0 foo;
to:
wire foo;
pulldown #(supply0) (foo);
This reduces the backend burden, and behaves exactly
the same. */
NetLogic*pull = 0;
if (wtype == NetNet::SUPPLY0 || wtype == NetNet::SUPPLY1) {
NetLogic::TYPE pull_type = (wtype==NetNet::SUPPLY1)
? NetLogic::PULLUP
: NetLogic::PULLDOWN;
pull = new NetLogic(scope, scope->local_symbol(),
1, pull_type, wid);
pull->set_line(*this);
pull->pin(0).drive0(Link::SUPPLY);
pull->pin(0).drive1(Link::SUPPLY);
des->add_node(pull);
wtype = NetNet::WIRE;
if (debug_elaborate) {
cerr << get_line() << ": debug: "
<< "Generate a SUPPLY pulldown for the "
<< "supply0 net." << endl;
}
}
perm_string name = peek_tail_name(hname_);
if (debug_elaborate) {
cerr << get_line() << ": debug: Create signal "
<< wtype << " ["<<msb<<":"<<lsb<<"] " << name
<< " in scope " << scope_path(scope) << endl;
}
NetNet*sig = array_dimensions > 0
? new NetNet(scope, name, wtype, msb, lsb, array_s0, array_e0)
: new NetNet(scope, name, wtype, msb, lsb);
ivl_variable_type_t use_data_type = data_type_;
if (use_data_type == IVL_VT_NO_TYPE) {
use_data_type = IVL_VT_LOGIC;
if (debug_elaborate) {
cerr << get_line() << ": debug: "
<< "Signal " << name
<< " in scope " << scope_path(scope)
<< " defaults to data type " << use_data_type << endl;
}
}
sig->data_type(use_data_type);
sig->set_line(*this);
sig->port_type(port_type_);
sig->set_signed(get_signed());
sig->set_isint(get_isint());
if (pull)
connect(sig->pin(0), pull->pin(0));
for (unsigned idx = 0 ; idx < nattrib ; idx += 1)
sig->attribute(attrib_list[idx].key, attrib_list[idx].val);
return sig;
}
/*
* $Log: elab_sig.cc,v $
* Revision 1.52 2007/06/02 03:42:12 steve
* Properly evaluate scope path expressions.
*
* Revision 1.51 2007/05/24 04:07:11 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.50 2007/04/26 03:06:22 steve
* Rework hname_t to use perm_strings.
*
* Revision 1.49 2007/04/02 01:12:34 steve
* Seperate arrayness from word count
*
* Revision 1.48 2007/03/08 06:11:35 steve
* Elaborate scopes of modules instantated in generate loops.
*
* Revision 1.47 2007/03/07 04:24:59 steve
* Make integer width controllable.
*
* Revision 1.46 2007/03/06 05:22:49 steve
* Support signed function return values.
*
* Revision 1.45 2007/02/01 05:24:08 steve
* Include type in signal create message.
*
* Revision 1.44 2007/01/29 02:07:34 steve
* Types of task/function arguments set in multiple steps.
*
* Revision 1.43 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory
* classes are removed from the ivl core program, and the IVL_LPM_RAM
* lpm type is removed from the ivl_target API.
*
* Revision 1.42 2006/06/02 04:48:50 steve
* Make elaborate_expr methods aware of the width that the context
* requires of it. In the process, fix sizing of the width of unary
* minus is context determined sizes.
*
* Revision 1.41 2006/04/10 00:37:42 steve
* Add support for generate loops w/ wires and gates.
*
* Revision 1.40 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.39 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*
* Revision 1.38 2005/02/13 01:15:07 steve
* Replace supply nets with wires connected to pullup/down supply devices.
*
* Revision 1.37 2004/12/11 02:31:25 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
* down this path.
*
* Revision 1.36 2004/09/27 22:34:10 steve
* Cleanup and factoring of autoconf.
*
* Revision 1.35 2004/09/05 17:44:41 steve
* Add support for module instance arrays.
*
* Revision 1.34 2004/05/31 23:34:37 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better
* speed and more type support.
*
* Revision 1.33 2004/02/18 17:11:55 steve
* Use perm_strings for named langiage items.
*
* Revision 1.32 2003/09/20 05:24:00 steve
* Evaluate memory index constants using elab_and_eval.
*
* Revision 1.31 2003/07/15 03:49:22 steve
* Spelling fixes.
*
* Revision 1.30 2003/06/24 01:38:02 steve
* Various warnings fixed.
*
* Revision 1.29 2003/06/21 01:21:43 steve
* Harmless fixup of warnings.
*
* Revision 1.28 2003/03/06 00:28:41 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.27 2003/01/30 16:23:07 steve
* Spelling fixes.
*
* Revision 1.26 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.25 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
* Revision 1.24 2002/08/05 04:18:45 steve
* Store only the base name of memories.
*
* Revision 1.23 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.22 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.21 2002/05/19 23:37:28 steve
* Parse port_declaration_lists from the 2001 Standard.
*
* Revision 1.20 2002/01/26 05:28:28 steve
* Detect scalar/vector declarion mismatch.
*
* Revision 1.19 2002/01/23 03:35:17 steve
* Detect incorrect function ports.
*
* Revision 1.18 2001/12/03 04:47:14 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.17 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
* Revision 1.16 2001/11/01 05:21:26 steve
* Catch ports that have no direction.
*
* Revision 1.15 2001/10/31 03:11:15 steve
* detect module ports not declared within the module.
*
* Revision 1.14 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.13 2001/05/25 02:21:34 steve
* Detect input and input ports declared as reg.
*
* Revision 1.12 2001/02/17 05:15:33 steve
* Allow task ports to be given real types.
*
* Revision 1.11 2001/02/10 20:29:39 steve
* In the context of range declarations, use elab_and_eval instead
* of the less robust eval_const methods.
*/
+2414 -1207
View File
File diff suppressed because it is too large Load Diff
+318 -323
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2000 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2005 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,214 +16,256 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: emit.cc,v 1.41 2000/04/23 03:45:24 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: emit.cc,v 1.89 2007/01/16 05:44:15 steve Exp $"
#endif
# include "config.h"
# include <iostream>
/*
* The emit function is called to generate the output required of the
* target.
*/
# include "target.h"
# include "netlist.h"
# include <iostream>
# include <typeinfo>
# include <cassert>
void NetNode::emit_node(ostream&o, struct target_t*tgt) const
bool NetNode::emit_node(struct target_t*tgt) const
{
cerr << "EMIT: Gate type? " << typeid(*this).name() << endl;
return false;
}
void NetLogic::emit_node(ostream&o, struct target_t*tgt) const
bool NetLogic::emit_node(struct target_t*tgt) const
{
tgt->logic(o, this);
tgt->logic(this);
return true;
}
void NetUDP_COMB::emit_node(ostream&o, struct target_t*tgt) const
bool NetUDP::emit_node(struct target_t*tgt) const
{
tgt->udp_comb(o, this);
tgt->udp(this);
return true;
}
void NetUDP::emit_node(ostream&o, struct target_t*tgt) const
bool NetAddSub::emit_node(struct target_t*tgt) const
{
tgt->udp(o, this);
tgt->lpm_add_sub(this);
return true;
}
void NetAddSub::emit_node(ostream&o, struct target_t*tgt) const
bool NetArrayDq::emit_node(struct target_t*tgt) const
{
tgt->lpm_add_sub(o, this);
return tgt->lpm_array_dq(this);
}
void NetAssign::emit_node(ostream&o, struct target_t*tgt) const
bool NetCaseCmp::emit_node(struct target_t*tgt) const
{
tgt->net_assign(o, this);
tgt->net_case_cmp(this);
return true;
}
void NetAssignNB::emit_node(ostream&o, struct target_t*tgt) const
bool NetCLShift::emit_node(struct target_t*tgt) const
{
tgt->net_assign_nb(o, this);
tgt->lpm_clshift(this);
return true;
}
void NetCaseCmp::emit_node(ostream&o, struct target_t*tgt) const
bool NetCompare::emit_node(struct target_t*tgt) const
{
tgt->net_case_cmp(o, this);
tgt->lpm_compare(this);
return true;
}
void NetCLShift::emit_node(ostream&o, struct target_t*tgt) const
bool NetConcat::emit_node(struct target_t*tgt) const
{
tgt->lpm_clshift(o, this);
return tgt->concat(this);
}
void NetCompare::emit_node(ostream&o, struct target_t*tgt) const
bool NetConst::emit_node(struct target_t*tgt) const
{
tgt->lpm_compare(o, this);
return tgt->net_const(this);
}
void NetConst::emit_node(ostream&o, struct target_t*tgt) const
bool NetDivide::emit_node(struct target_t*tgt) const
{
tgt->net_const(o, this);
tgt->lpm_divide(this);
return true;
}
void NetDivide::emit_node(ostream&o, struct target_t*tgt) const
bool NetFF::emit_node(struct target_t*tgt) const
{
tgt->lpm_divide(o, this);
tgt->lpm_ff(this);
return true;
}
void NetFF::emit_node(ostream&o, struct target_t*tgt) const
bool NetLiteral::emit_node(struct target_t*tgt) const
{
tgt->lpm_ff(o, this);
return tgt->net_literal(this);
}
void NetForce::emit_node(ostream&o, struct target_t*tgt) const
bool NetModulo::emit_node(struct target_t*tgt) const
{
tgt->net_force(o, this);
tgt->lpm_modulo(this);
return true;
}
void NetMult::emit_node(ostream&o, struct target_t*tgt) const
bool NetMult::emit_node(struct target_t*tgt) const
{
tgt->lpm_mult(o, this);
tgt->lpm_mult(this);
return true;
}
void NetMux::emit_node(ostream&o, struct target_t*tgt) const
bool NetMux::emit_node(struct target_t*tgt) const
{
tgt->lpm_mux(o, this);
tgt->lpm_mux(this);
return true;
}
void NetRamDq::emit_node(ostream&o, struct target_t*tgt) const
bool NetPartSelect::emit_node(struct target_t*tgt) const
{
tgt->lpm_ram_dq(o, this);
return tgt->part_select(this);
}
void NetBUFZ::emit_node(ostream&o, struct target_t*tgt) const
bool NetReplicate::emit_node(struct target_t*tgt) const
{
tgt->bufz(o, this);
return tgt->replicate(this);
}
bool NetProcTop::emit(ostream&o, struct target_t*tgt) const
bool NetSignExtend::emit_node(struct target_t*tgt) const
{
return tgt->process(o, this);
return tgt->sign_extend(this);
}
bool NetProc::emit_proc(ostream&o, struct target_t*tgt) const
bool NetUReduce::emit_node(struct target_t*tgt) const
{
return tgt->ureduce(this);
}
bool NetSysFunc::emit_node(struct target_t*tgt) const
{
return tgt->net_sysfunction(this);
}
bool NetUserFunc::emit_node(struct target_t*tgt) const
{
return tgt->net_function(this);
}
bool NetBUFZ::emit_node(struct target_t*tgt) const
{
return tgt->bufz(this);
}
bool NetProcTop::emit(struct target_t*tgt) const
{
return tgt->process(this);
}
bool NetProc::emit_proc(struct target_t*tgt) const
{
cerr << "EMIT: Proc type? " << typeid(*this).name() << endl;
return false;
}
bool NetAssign::emit_proc(ostream&o, struct target_t*tgt) const
bool NetAssign::emit_proc(struct target_t*tgt) const
{
tgt->proc_assign(o, this);
tgt->proc_assign(this);
return true;
}
bool NetAssignNB::emit_proc(ostream&o, struct target_t*tgt) const
bool NetAssignNB::emit_proc(struct target_t*tgt) const
{
tgt->proc_assign_nb(o, this);
tgt->proc_assign_nb(this);
return true;
}
bool NetAssignMem::emit_proc(ostream&o, struct target_t*tgt) const
bool NetBlock::emit_proc(struct target_t*tgt) const
{
tgt->proc_assign_mem(o, this);
return tgt->proc_block(this);
}
bool NetCase::emit_proc(struct target_t*tgt) const
{
tgt->proc_case(this);
return true;
}
bool NetAssignMemNB::emit_proc(ostream&o, struct target_t*tgt) const
bool NetCAssign::emit_proc(struct target_t*tgt) const
{
tgt->proc_assign_mem_nb(o, this);
return tgt->proc_cassign(this);
}
bool NetCondit::emit_proc(struct target_t*tgt) const
{
return tgt->proc_condit(this);
}
bool NetDeassign::emit_proc(struct target_t*tgt) const
{
return tgt->proc_deassign(this);
}
bool NetDisable::emit_proc(struct target_t*tgt) const
{
return tgt->proc_disable(this);
}
bool NetForce::emit_proc(struct target_t*tgt) const
{
return tgt->proc_force(this);
}
bool NetForever::emit_proc(struct target_t*tgt) const
{
tgt->proc_forever(this);
return true;
}
bool NetBlock::emit_proc(ostream&o, struct target_t*tgt) const
bool NetPDelay::emit_proc(struct target_t*tgt) const
{
return tgt->proc_block(o, this);
return tgt->proc_delay(this);
}
bool NetCase::emit_proc(ostream&o, struct target_t*tgt) const
bool NetPDelay::emit_proc_recurse(struct target_t*tgt) const
{
tgt->proc_case(o, this);
if (statement_) return statement_->emit_proc(tgt);
return true;
}
bool NetCondit::emit_proc(ostream&o, struct target_t*tgt) const
bool NetRelease::emit_proc(struct target_t*tgt) const
{
tgt->proc_condit(o, this);
return tgt->proc_release(this);
}
bool NetRepeat::emit_proc(struct target_t*tgt) const
{
tgt->proc_repeat(this);
return true;
}
bool NetForce::emit_proc(ostream&o, struct target_t*tgt) const
bool NetSTask::emit_proc(struct target_t*tgt) const
{
return tgt->proc_force(o, this);
}
bool NetForever::emit_proc(ostream&o, struct target_t*tgt) const
{
tgt->proc_forever(o, this);
tgt->proc_stask(this);
return true;
}
bool NetPDelay::emit_proc(ostream&o, struct target_t*tgt) const
bool NetUTask::emit_proc(struct target_t*tgt) const
{
tgt->proc_delay(o, this);
tgt->proc_utask(this);
return true;
}
void NetPDelay::emit_proc_recurse(ostream&o, struct target_t*tgt) const
bool NetWhile::emit_proc(struct target_t*tgt) const
{
if (statement_) statement_->emit_proc(o, tgt);
}
bool NetRelease::emit_proc(ostream&o, struct target_t*tgt) const
{
return tgt->proc_release(o, this);
}
bool NetRepeat::emit_proc(ostream&o, struct target_t*tgt) const
{
tgt->proc_repeat(o, this);
tgt->proc_while(this);
return true;
}
bool NetSTask::emit_proc(ostream&o, struct target_t*tgt) const
{
tgt->proc_stask(o, this);
return true;
}
bool NetUTask::emit_proc(ostream&o, struct target_t*tgt) const
{
tgt->proc_utask(o, this);
return true;
}
bool NetWhile::emit_proc(ostream&o, struct target_t*tgt) const
{
tgt->proc_while(o, this);
return true;
}
void NetBlock::emit_recurse(ostream&o, struct target_t*tgt) const
void NetBlock::emit_recurse(struct target_t*tgt) const
{
if (last_ == 0)
return;
@@ -231,129 +273,164 @@ void NetBlock::emit_recurse(ostream&o, struct target_t*tgt) const
NetProc*cur = last_;
do {
cur = cur->next_;
cur->emit_proc(o, tgt);
cur->emit_proc(tgt);
} while (cur != last_);
}
void NetCondit::emit_recurse_if(ostream&o, struct target_t*tgt) const
bool NetCondit::emit_recurse_if(struct target_t*tgt) const
{
if (if_)
if_->emit_proc(o, tgt);
return if_->emit_proc(tgt);
else
return true;
}
void NetCondit::emit_recurse_else(ostream&o, struct target_t*tgt) const
bool NetCondit::emit_recurse_else(struct target_t*tgt) const
{
if (else_)
else_->emit_proc(o, tgt);
return else_->emit_proc(tgt);
else
return true;
}
void NetEvProbe::emit_node(ostream&o, struct target_t*tgt) const
bool NetEvProbe::emit_node(struct target_t*tgt) const
{
tgt->net_probe(o, this);
tgt->net_probe(this);
return true;
}
bool NetEvTrig::emit_proc(ostream&o, struct target_t*tgt) const
bool NetEvTrig::emit_proc(struct target_t*tgt) const
{
return tgt->proc_trigger(o, this);
return tgt->proc_trigger(this);
}
bool NetEvWait::emit_proc(ostream&o, struct target_t*tgt) const
bool NetEvWait::emit_proc(struct target_t*tgt) const
{
return tgt->proc_wait(o, this);
return tgt->proc_wait(this);
}
bool NetEvWait::emit_recurse(ostream&o, struct target_t*tgt) const
bool NetEvWait::emit_recurse(struct target_t*tgt) const
{
if (!statement_) return true;
return statement_->emit_proc(o, tgt);
return statement_->emit_proc(tgt);
}
void NetForever::emit_recurse(ostream&o, struct target_t*tgt) const
void NetForever::emit_recurse(struct target_t*tgt) const
{
if (statement_)
statement_->emit_proc(o, tgt);
statement_->emit_proc(tgt);
}
void NetRepeat::emit_recurse(ostream&o, struct target_t*tgt) const
void NetRepeat::emit_recurse(struct target_t*tgt) const
{
if (statement_)
statement_->emit_proc(o, tgt);
statement_->emit_proc(tgt);
}
void NetScope::emit_scope(ostream&o, struct target_t*tgt) const
void NetScope::emit_scope(struct target_t*tgt) const
{
tgt->scope(o, this);
tgt->scope(this);
for (NetEvent*cur = events_ ; cur ; cur = cur->snext_)
tgt->event(o, cur);
tgt->event(cur);
for (NetScope*cur = sub_ ; cur ; cur = cur->sib_)
cur->emit_scope(o, tgt);
}
cur->emit_scope(tgt);
void NetWhile::emit_proc_recurse(ostream&o, struct target_t*tgt) const
{
proc_->emit_proc(o, tgt);
}
bool Design::emit(ostream&o, struct target_t*tgt) const
{
bool rc = true;
tgt->start_design(o, this);
// enumerate the scopes
root_scope_->emit_scope(o, tgt);
// emit signals
if (signals_) {
NetNet*cur = signals_->sig_next_;
do {
tgt->signal(o, cur);
tgt->signal(cur);
cur = cur->sig_next_;
} while (cur != signals_->sig_next_);
/* Run the signals again, but this time to connect the
delay paths. This is done as a second pass because
the paths reference other signals that may be later
in the list. We can do it here becase delay paths are
always connected within the scope. */
cur = signals_->sig_next_;
do {
tgt->signal_paths(cur);
cur = cur->sig_next_;
} while (cur != signals_->sig_next_);
}
}
// emit memories
{
map<string,NetMemory*>::const_iterator mi;
for (mi = memories_.begin() ; mi != memories_.end() ; mi++) {
tgt->memory(o, (*mi).second);
}
bool NetScope::emit_defs(struct target_t*tgt) const
{
bool flag = true;
switch (type_) {
case MODULE:
for (NetScope*cur = sub_ ; cur ; cur = cur->sib_)
flag &= cur->emit_defs(tgt);
break;
case FUNC:
flag &= tgt->func_def(this);
break;
case TASK:
tgt->task_def(this);
break;
default: /* BEGIN_END and FORK_JOIN, do nothing */
break;
}
return flag;
}
void NetWhile::emit_proc_recurse(struct target_t*tgt) const
{
proc_->emit_proc(tgt);
}
int Design::emit(struct target_t*tgt) const
{
int rc = 0;
if (tgt->start_design(this) == false)
return -2;
// enumerate the scopes
for (list<NetScope*>::const_iterator scope = root_scopes_.begin();
scope != root_scopes_.end(); scope++)
(*scope)->emit_scope(tgt);
// emit nodes
bool nodes_rc = true;
if (nodes_) {
NetNode*cur = nodes_->node_next_;
do {
cur->emit_node(o, tgt);
nodes_rc = nodes_rc && cur->emit_node(tgt);
cur = cur->node_next_;
} while (cur != nodes_->node_next_);
}
// emit function definitions
{
map<string,NetFuncDef*>::const_iterator ta;
for (ta = funcs_.begin() ; ta != funcs_.end() ; ta ++) {
tgt->func_def(o, (*ta).second);
}
}
// emit task and function definitions
bool tasks_rc = true;
for (list<NetScope*>::const_iterator scope = root_scopes_.begin();
scope != root_scopes_.end(); scope++)
tasks_rc &= (*scope)->emit_defs(tgt);
// emit task definitions
{
map<string,NetTaskDef*>::const_iterator ta;
for (ta = tasks_.begin() ; ta != tasks_.end() ; ta ++) {
tgt->task_def(o, (*ta).second);
}
}
// emit the processes
bool proc_rc = true;
for (const NetProcTop*idx = procs_ ; idx ; idx = idx->next_)
rc = rc && idx->emit(o, tgt);
proc_rc &= idx->emit(tgt);
rc = tgt->end_design(this);
if (nodes_rc == false)
return -1;
if (tasks_rc == false)
return -2;
if (proc_rc == false)
return -3;
tgt->end_design(o, this);
return rc;
}
@@ -372,14 +449,19 @@ void NetEConst::expr_scan(struct expr_scan_t*tgt) const
tgt->expr_const(this);
}
void NetEIdent::expr_scan(struct expr_scan_t*tgt) const
void NetEConstParam::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_ident(this);
tgt->expr_param(this);
}
void NetEMemory::expr_scan(struct expr_scan_t*tgt) const
void NetECReal::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_memory(this);
tgt->expr_creal(this);
}
void NetECRealParam::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_rparam(this);
}
void NetEParam::expr_scan(struct expr_scan_t*tgt) const
@@ -388,11 +470,26 @@ void NetEParam::expr_scan(struct expr_scan_t*tgt) const
<< endl;
}
void NetEEvent::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_event(this);
}
void NetEScope::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_scope(this);
}
void NetESelect::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_select(this);
}
void NetESFunc::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_sfunc(this);
}
void NetEUFunc::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_ufunc(this);
@@ -403,11 +500,6 @@ void NetESignal::expr_scan(struct expr_scan_t*tgt) const
tgt->expr_signal(this);
}
void NetESubSignal::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_subsignal(this);
}
void NetETernary::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_ternary(this);
@@ -418,192 +510,95 @@ void NetEUnary::expr_scan(struct expr_scan_t*tgt) const
tgt->expr_unary(this);
}
bool emit(ostream&o, const Design*des, const char*type)
int emit(const Design*des, const char*type)
{
for (unsigned idx = 0 ; target_table[idx] ; idx += 1) {
const struct target*tgt = target_table[idx];
if (tgt->name == type)
return des->emit(o, tgt->meth);
if (strcmp(tgt->name, type) == 0)
return des->emit(tgt->meth);
}
cerr << "error: Code generator type " << type
<< " not found." << endl;
return -1;
}
/*
* $Log: emit.cc,v $
* Revision 1.41 2000/04/23 03:45:24 steve
* Add support for the procedural release statement.
* Revision 1.89 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory
* classes are removed from the ivl core program, and the IVL_LPM_RAM
* lpm type is removed from the ivl_target API.
*
* Revision 1.40 2000/04/22 04:20:19 steve
* Add support for force assignment.
* Revision 1.88 2006/11/10 05:44:44 steve
* Process delay paths in second path over signals.
*
* Revision 1.39 2000/04/12 04:23:58 steve
* Named events really should be expressed with PEIdent
* objects in the pform,
* Revision 1.87 2006/06/18 04:15:50 steve
* Add support for system functions in continuous assignments.
*
* Handle named events within the mix of net events
* and edges. As a unified lot they get caught together.
* wait statements are broken into more complex statements
* that include a conditional.
* Revision 1.86 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Do not generate NetPEvent or NetNEvent objects in
* elaboration. NetEvent, NetEvWait and NetEvProbe
* take over those functions in the netlist.
* Revision 1.85 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*
* Revision 1.38 2000/04/10 05:26:06 steve
* All events now use the NetEvent class.
* Revision 1.84 2005/05/24 01:44:27 steve
* Do sign extension of structuran nets.
*
* Revision 1.37 2000/04/04 03:20:15 steve
* Simulate named event trigger and waits.
* Revision 1.83 2005/02/08 00:12:36 steve
* Add the NetRepeat node, and code generator support.
*
* Revision 1.36 2000/04/01 21:40:22 steve
* Add support for integer division.
* Revision 1.82 2005/02/03 04:56:20 steve
* laborate reduction gates into LPM_RED_ nodes.
*
* Revision 1.35 2000/03/29 04:37:11 steve
* New and improved combinational primitives.
* Revision 1.81 2005/01/24 05:28:30 steve
* Remove the NetEBitSel and combine all bit/part select
* behavior into the NetESelect node and IVL_EX_SELECT
* ivl_target expression type.
*
* Revision 1.34 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
* in a separate pass over the pform. Once the scopes
* are generated, I can process overrides and evalutate
* paremeters before elaboration begins.
* Revision 1.80 2005/01/22 01:06:55 steve
* Change case compare from logic to an LPM node.
*
* Revision 1.33 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
* Revision 1.79 2004/12/29 23:55:43 steve
* Unify elaboration of l-values for all proceedural assignments,
* including assing, cassign and force.
*
* Revision 1.32 2000/01/13 03:35:35 steve
* Multiplication all the way to simulation.
* Generate NetConcat devices for gate outputs that feed into a
* vector results. Use this to hande gate arrays. Also let gate
* arrays handle vectors of gates when the outputs allow for it.
*
* Revision 1.31 1999/11/28 23:42:02 steve
* NetESignal object no longer need to be NetNode
* objects. Let them keep a pointer to NetNet objects.
* Revision 1.78 2004/12/11 02:31:26 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes
* down this path.
*
* Revision 1.30 1999/11/27 19:07:57 steve
* Support the creation of scopes.
* Revision 1.77 2004/10/04 01:10:53 steve
* Clean up spurious trailing white space.
*
* Revision 1.29 1999/11/21 00:13:08 steve
* Support memories in continuous assignments.
* Revision 1.76 2004/05/31 23:34:37 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better
* speed and more type support.
*
* Revision 1.28 1999/11/14 23:43:45 steve
* Support combinatorial comparators.
* Revision 1.75 2003/09/13 01:30:07 steve
* Missing case warnings.
*
* Revision 1.27 1999/11/14 20:24:28 steve
* Add support for the LPM_CLSHIFT device.
* Revision 1.74 2003/05/30 02:55:32 steve
* Support parameters in real expressions and
* as real expressions, and fix multiply and
* divide with real results.
*
* Revision 1.26 1999/11/04 03:53:26 steve
* Patch to synthesize unary ~ and the ternary operator.
* Thanks to Larry Doolittle <LRDoolittle@lbl.gov>.
* Revision 1.73 2003/04/22 04:48:29 steve
* Support event names as expressions elements.
*
* Add the LPM_MUX device, and integrate it with the
* ternary synthesis from Larry. Replace the lpm_mux
* generator in t-xnf.cc to use XNF EQU devices to
* put muxs into function units.
*
* Rewrite elaborate_net for the PETernary class to
* also use the LPM_MUX device.
*
* Revision 1.25 1999/11/01 02:07:40 steve
* Add the synth functor to do generic synthesis
* and add the LPM_FF device to handle rows of
* flip-flops.
*
* Revision 1.24 1999/10/10 01:59:54 steve
* Structural case equals device.
*
* Revision 1.23 1999/09/22 16:57:23 steve
* Catch parallel blocks in vvm emit.
*
* Revision 1.22 1999/09/20 02:21:10 steve
* Elaborate parameters in phases.
*
* Revision 1.21 1999/09/15 01:55:06 steve
* Elaborate non-blocking assignment to memories.
*
* Revision 1.20 1999/09/03 04:28:38 steve
* elaborate the binary plus operator.
*
* Revision 1.19 1999/08/31 22:38:29 steve
* Elaborate and emit to vvm procedural functions.
*
* Revision 1.18 1999/07/17 19:50:59 steve
* netlist support for ternary operator.
*
* Revision 1.17 1999/07/17 03:39:11 steve
* simplified process scan for targets.
*
* Revision 1.16 1999/07/07 04:20:57 steve
* Emit vvm for user defined tasks.
*
* Revision 1.15 1999/07/03 02:12:51 steve
* Elaborate user defined tasks.
*
* Revision 1.14 1999/06/19 21:06:16 steve
* Elaborate and supprort to vvm the forever
* and repeat statements.
*
* Revision 1.13 1999/06/09 03:00:06 steve
* Add support for procedural concatenation expression.
*
* Revision 1.12 1999/06/06 20:45:38 steve
* Add parse and elaboration of non-blocking assignments,
* Replace list<PCase::Item*> with an svector version,
* Add integer support.
*
* Revision 1.11 1999/05/12 04:03:19 steve
* emit NetAssignMem objects in vvm target.
*
* Revision 1.10 1999/05/07 01:21:18 steve
* Handle total lack of nodes and signals.
*
* Revision 1.9 1999/05/01 02:57:53 steve
* Handle much more complex event expressions.
*
* Revision 1.8 1999/04/25 00:44:10 steve
* Core handles subsignal expressions.
*
* Revision 1.7 1999/04/19 01:59:36 steve
* Add memories to the parse and elaboration phases.
*
* Revision 1.6 1999/02/08 02:49:56 steve
* Turn the NetESignal into a NetNode so
* that it can connect to the netlist.
* Implement the case statement.
* Convince t-vvm to output code for
* the case statement.
*
* Revision 1.5 1999/02/01 00:26:49 steve
* Carry some line info to the netlist,
* Dump line numbers for processes.
* Elaborate prints errors about port vector
* width mismatch
* Emit better handles null statements.
*
* Revision 1.4 1998/12/01 00:42:14 steve
* Elaborate UDP devices,
* Support UDP type attributes, and
* pass those attributes to nodes that
* are instantiated by elaboration,
* Put modules into a map instead of
* a simple list.
*
* Revision 1.3 1998/11/09 18:55:34 steve
* Add procedural while loops,
* Parse procedural for loops,
* Add procedural wait statements,
* Add constant nodes,
* Add XNOR logic gate,
* Make vvm output look a bit prettier.
*
* Revision 1.2 1998/11/07 17:05:05 steve
* Handle procedural conditional, and some
* of the conditional expressions.
*
* Elaborate signals and identifiers differently,
* allowing the netlist to hold signal information.
*
* Revision 1.1 1998/11/03 23:28:57 steve
* Introduce verilog to CVS.
* Revision 1.72 2003/03/10 23:40:53 steve
* Keep parameter constants for the ivl_target API.
*
* Revision 1.71 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
*/
+277 -84
View File
@@ -16,114 +16,218 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: eval.cc,v 1.14 2000/03/08 04:36:53 steve Exp $"
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval.cc,v 1.47 2007/06/04 19:14:06 steve Exp $"
#endif
# include "config.h"
# include <iostream>
# include "PExpr.h"
# include "netlist.h"
# include "netmisc.h"
# include "compiler.h"
verinum* PExpr::eval_const(const Design*, const string&) const
verinum* PExpr::eval_const(Design*, NetScope*) const
{
return 0;
}
verinum* PEBinary::eval_const(const Design*des, const string&path) const
verinum* PEBinary::eval_const(Design*des, NetScope*scope) const
{
verinum*l = left_->eval_const(des, path);
verinum*l = left_->eval_const(des, scope);
if (l == 0) return 0;
verinum*r = right_->eval_const(des, path);
verinum*r = right_->eval_const(des, scope);
if (r == 0) {
delete l;
return 0;
}
verinum*res;
switch (op_) {
case '+': {
assert(l->is_defined());
assert(r->is_defined());
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv+rv, l->len());
if (l->is_defined() && r->is_defined()) {
res = new verinum(*l + *r);
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case '-': {
assert(l->is_defined());
assert(r->is_defined());
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv-rv, l->len());
if (l->is_defined() && r->is_defined()) {
res = new verinum(*l - *r);
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case '*': {
assert(l->is_defined());
assert(r->is_defined());
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv * rv, l->len());
if (l->is_defined() && r->is_defined()) {
res = new verinum(*l * *r);
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case '/': {
assert(l->is_defined());
assert(r->is_defined());
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv / rv, l->len());
if (l->is_defined() && r->is_defined()) {
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv / rv, l->len());
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case '%': {
assert(l->is_defined());
assert(r->is_defined());
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv % rv, l->len());
if (l->is_defined() && r->is_defined()) {
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv % rv, l->len());
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case '>': {
if (l->is_defined() && r->is_defined()) {
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv > rv, l->len());
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case '<': {
if (l->is_defined() && r->is_defined()) {
long lv = l->as_long();
long rv = r->as_long();
res = new verinum(lv < rv, l->len());
} else {
res = new verinum(verinum::Vx, l->len());
}
break;
}
case 'l': { // left shift (<<)
assert(r->is_defined());
unsigned long rv = r->as_ulong();
res = new verinum(verinum::V0, l->len());
if (rv < res->len()) {
unsigned cnt = res->len() - rv;
for (unsigned idx = 0 ; idx < cnt ; idx += 1)
res->set(idx+rv, l->get(idx));
}
break;
}
case 'r': { // right shift (>>)
assert(r->is_defined());
unsigned long rv = r->as_ulong();
res = new verinum(verinum::V0, l->len());
if (rv < res->len()) {
unsigned cnt = res->len() - rv;
for (unsigned idx = 0 ; idx < cnt ; idx += 1)
res->set(idx, l->get(idx+rv));
}
break;
}
default:
delete l;
delete r;
return 0;
}
delete l;
delete r;
return res;
}
verinum* PEConcat::eval_const(Design*des, NetScope*scope) const
{
verinum*accum = parms_[0]->eval_const(des, scope);
if (accum == 0)
return 0;
for (unsigned idx = 1 ; idx < parms_.count() ; idx += 1) {
verinum*tmp = parms_[idx]->eval_const(des, scope);
if (tmp == 0) {
delete accum;
return 0;
}
assert(tmp);
*accum = concat(*accum, *tmp);
delete tmp;
}
return accum;
}
/*
* Evaluate an identifier as a constant expression. This is only
* possible if the identifier is that of a parameter.
*/
verinum* PEIdent::eval_const(const Design*des, const string&path) const
verinum* PEIdent::eval_const(Design*des, NetScope*scope) const
{
const NetScope*scope = des->find_scope(path);
assert(scope);
const NetExpr*expr = des->find_parameter(scope, text_);
NetNet*net;
NetEvent*eve;
const NetExpr*expr;
const name_component_t&name_tail = path_.back();
// Handle the special case that this ident is a genvar
// variable name. In that case, the genvar meaning preempts
// everything and we just return that value immediately.
if (scope->genvar_tmp
&& strcmp(name_tail.name,scope->genvar_tmp) == 0) {
return new verinum(scope->genvar_tmp_val);
}
symbol_search(des, scope, path_, net, expr, eve);
if (expr == 0)
return 0;
assert(msb_ == 0);
if (dynamic_cast<const NetEParam*>(expr)) {
cerr << get_line() << ": sorry: I cannot evaluate ``" <<
text_ << "'' in this context." << endl;
const NetEConst*eval = dynamic_cast<const NetEConst*>(expr);
if (eval == 0) {
cerr << get_line() << ": internal error: Unable to evaluate "
<< "constant expression (parameter=" << path_
<< "): " << *expr << endl;
return 0;
}
const NetEConst*eval = dynamic_cast<const NetEConst*>(expr);
assert(eval);
if (!name_tail.index.empty())
return 0;
return new verinum(eval->value());
}
verinum* PENumber::eval_const(const Design*, const string&) const
verinum* PEFNumber::eval_const(Design*, NetScope*) const
{
long val = value_->as_long();
return new verinum(val);
}
verinum* PENumber::eval_const(Design*, NetScope*) const
{
return new verinum(value());
}
verinum* PETernary::eval_const(const Design*des, const string&path) const
verinum* PEString::eval_const(Design*, NetScope*) const
{
verinum*test = expr_->eval_const(des, path);
return new verinum(string(text_));
}
verinum* PETernary::eval_const(Design*des, NetScope*scope) const
{
verinum*test = expr_->eval_const(des, scope);
if (test == 0)
return 0;
@@ -131,9 +235,9 @@ verinum* PETernary::eval_const(const Design*des, const string&path) const
delete test;
switch (bit) {
case verinum::V0:
return fal_->eval_const(des, path);
return fal_->eval_const(des, scope);
case verinum::V1:
return tru_->eval_const(des, path);
return tru_->eval_const(des, scope);
default:
return 0;
// XXXX It is possible to handle this case if both fal_
@@ -141,61 +245,150 @@ verinum* PETernary::eval_const(const Design*des, const string&path) const
}
}
verinum* PEUnary::eval_const(Design*des, NetScope*scope) const
{
verinum*val = expr_->eval_const(des, scope);
if (val == 0)
return 0;
switch (op_) {
case '+':
return val;
case '-': {
/* We need to expand the value a bit if we are
taking the 2's complement so that we are
guaranteed to not overflow. */
verinum tmp ((uint64_t)0, val->len()+1);
for (unsigned idx = 0 ; idx < val->len() ; idx += 1)
tmp.set(idx, val->get(idx));
*val = v_not(tmp) + verinum(verinum::V1, 1);
val->has_sign(true);
return val;
}
}
delete val;
return 0;
}
/*
* $Log: eval.cc,v $
* Revision 1.14 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
* in a separate pass over the pform. Once the scopes
* are generated, I can process overrides and evalutate
* paremeters before elaboration begins.
* Revision 1.47 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Revision 1.13 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
* Revision 1.46 2007/05/24 04:07:12 steve
* Rework the heirarchical identifier parse syntax and pform
* to handle more general combinations of heirarch and bit selects.
*
* Revision 1.12 1999/11/30 04:48:17 steve
* Handle evaluation of ternary during elaboration.
* Revision 1.45 2007/03/07 00:38:15 steve
* Lint fixes.
*
* Revision 1.11 1999/11/28 23:42:02 steve
* NetESignal object no longer need to be NetNode
* objects. Let them keep a pointer to NetNet objects.
* Revision 1.44 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory
* classes are removed from the ivl core program, and the IVL_LPM_RAM
* lpm type is removed from the ivl_target API.
*
* Revision 1.10 1999/11/21 20:03:24 steve
* Handle multiply in constant expressions.
* Revision 1.43 2006/08/08 05:11:37 steve
* Handle 64bit delay constants.
*
* Revision 1.9 1999/10/08 17:48:09 steve
* Support + in constant expressions.
* Revision 1.42 2006/05/19 04:07:24 steve
* eval_const is not strict.
*
* Revision 1.8 1999/09/20 02:21:10 steve
* Elaborate parameters in phases.
* Revision 1.41 2006/05/17 16:49:30 steve
* Error message if concat expression cannot evaluate.
*
* Revision 1.7 1999/09/18 01:52:48 steve
* Remove spurious message.
* Revision 1.40 2006/04/10 00:37:42 steve
* Add support for generate loops w/ wires and gates.
*
* Revision 1.6 1999/09/16 04:18:15 steve
* elaborate concatenation repeats.
* Revision 1.39 2005/12/07 04:04:23 steve
* Allow constant concat expressions.
*
* Revision 1.5 1999/08/06 04:05:28 steve
* Handle scope of parameters.
* Revision 1.38 2005/11/27 17:01:57 steve
* Fix for stubborn compiler.
*
* Revision 1.4 1999/07/17 19:51:00 steve
* netlist support for ternary operator.
* Revision 1.37 2005/11/27 05:56:20 steve
* Handle bit select of parameter with ranges.
*
* Revision 1.3 1999/05/30 01:11:46 steve
* Exressions are trees that can duplicate, and not DAGS.
* Revision 1.36 2003/06/21 01:21:43 steve
* Harmless fixup of warnings.
*
* Revision 1.2 1999/05/10 00:16:58 steve
* Parse and elaborate the concatenate operator
* in structural contexts, Replace vector<PExpr*>
* and list<PExpr*> with svector<PExpr*>, evaluate
* constant expressions with parameters, handle
* memories as lvalues.
* Revision 1.35 2003/04/14 03:40:21 steve
* Make some effort to preserve bits while
* operating on constant values.
*
* Parse task declarations, integer types.
* Revision 1.34 2003/03/26 06:16:18 steve
* Evaluate > and < in constant expressions.
*
* Revision 1.1 1998/11/03 23:28:58 steve
* Introduce verilog to CVS.
* Revision 1.33 2003/03/10 23:40:53 steve
* Keep parameter constants for the ivl_target API.
*
* Revision 1.32 2002/10/19 22:59:49 steve
* Redo the parameter vector support to allow
* parameter names in range expressions.
*
* Revision 1.31 2002/10/13 05:01:07 steve
* More verbose eval_const assert message.
*
* Revision 1.30 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
* Revision 1.29 2002/06/07 02:57:54 steve
* Simply give up on constants with indices.
*
* Revision 1.28 2002/06/06 18:57:04 steve
* Better error for identifier index eval.
*
* Revision 1.27 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.26 2001/12/29 22:10:10 steve
* constant eval of arithmetic with x and z.
*
* Revision 1.25 2001/12/29 00:43:55 steve
* Evaluate constant right shifts.
*
* Revision 1.24 2001/12/03 04:47:15 steve
* Parser and pform use hierarchical names as hname_t
* objects instead of encoded strings.
*
* Revision 1.23 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
* Revision 1.22 2001/11/06 06:11:55 steve
* Support more real arithmetic in delay constants.
*
* Revision 1.21 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)
*
* Revision 1.20 2001/02/09 02:49:59 steve
* Be more clear about scope of failure.
*
* Revision 1.19 2001/01/27 05:41:48 steve
* Fix sign extension of evaluated constants. (PR#91)
*
* Revision 1.18 2001/01/14 23:04:56 steve
* Generalize the evaluation of floating point delays, and
* get it working with delay assignment statements.
*
* Allow parameters to be referenced by hierarchical name.
*
* Revision 1.17 2001/01/04 04:47:51 steve
* Add support for << is signal indices.
*
* Revision 1.16 2000/12/10 22:01:36 steve
* Support decimal constants in behavioral delays.
*
* Revision 1.15 2000/09/07 22:38:13 steve
* Support unary + and - in constants.
*/
+109
View File
@@ -0,0 +1,109 @@
/*
* Copyright (c) 2002-2004 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_attrib.cc,v 1.9 2007/06/04 19:14:06 steve Exp $"
#endif
# include "config.h"
# include "util.h"
# include "PExpr.h"
# include "netlist.h"
# include <iostream>
# include <assert.h>
/*
* The evaluate_attributes function evaluates the attribute
* expressions from the map, and returns a table in a form suitable
* for passing to netlist devices.
*/
attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
unsigned&natt,
Design*des, NetScope*scope)
{
natt = att.size();
if (natt == 0)
return 0;
attrib_list_t*table = new attrib_list_t [natt];
unsigned idx = 0;
typedef map<perm_string,PExpr*>::const_iterator iter_t;
for (iter_t cur = att.begin() ; cur != att.end() ; cur ++, idx++) {
table[idx].key = (*cur).first;
PExpr*exp = (*cur).second;
/* If the attribute value is given in the source, then
evaluate it as a constant. If the value is not
given, then assume the value is 1. */
verinum*tmp;
if (exp)
tmp = exp->eval_const(des, scope);
else
tmp = new verinum(1);
if (tmp == 0)
cerr << "internal error: no result for " << *exp << endl;
assert(tmp);
table[idx].val = *tmp;
delete tmp;
}
assert(idx == natt);
return table;
}
/*
* $Log: eval_attrib.cc,v $
* Revision 1.9 2007/06/04 19:14:06 steve
* Build errors in picky GCC compilers.
*
* Revision 1.8 2005/11/27 17:01:57 steve
* Fix for stubborn compiler.
*
* Revision 1.7 2004/02/20 18:53:35 steve
* Addtrbute keys are perm_strings.
*
* Revision 1.6 2003/01/27 05:09:17 steve
* Spelling fixes.
*
* Revision 1.5 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
* Revision 1.4 2002/08/10 21:59:39 steve
* The default attribute value is 1.
*
* Revision 1.3 2002/06/06 18:57:18 steve
* Use standard name for iostream.
*
* Revision 1.2 2002/06/03 03:55:14 steve
* compile warnings.
*
* Revision 1.1 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
*/
+1534 -97
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
,*
hello_vpi.vpi
show_vcd.vcd
+87
View File
@@ -0,0 +1,87 @@
/*
* Copyright (c) 2000 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*
* This source file demonstrates how to synthesize CLB flip-flops from
* Icarus Verilog, including giving the device an initial value.
*
* To compile this for XNF, try a command like this:
*
* iverilog -txnf -ppart=XC4010XLPQ160 -pncf=clbff.ncf -oclbff.xnf clbff.v
*
* That command causes an clbff.xnf and clbff.ncf file to be created.
* Next, make the clbff.ngd file with the command:
*
* xnf2ngd -l xilinxun -u clbff.xnf clbff.ngo
* ngdbuild clbff.ngo clbff.ngd
*
* Finally, map the file to fully render it in the target part. The
* par command is the step that actually optimizes the design and tries
* to meet timing constraints.
*
* map -o map.ncd clbff.ngd
* par -w map.ncd clbff.ncd
*
* At this point, you can use the FPGA Editor to edit the clbff.ncd
* file. Notice that the design uses two CLB flip-flops (possibly in
* the same CLB) with their outputs ANDed together. If you go into the
* block editor, you will see that the FF connected to main/Q<0> is
* configured so start up reset, and the FF connected to main/Q<1> is
* configured to start up set.
*/
module main;
wire clk, iclk;
wire i0, i1;
wire out;
wire [1:0] D = {i1, i0};
// This statement declares Q to be a 2 bit reg vector. The
// initial assignment will cause the synthesized device to take
// on an initial value specified here. Without the assignment,
// the initial value is unspecified. (Verilog simulates it as 2'bx.)
reg [1:0] Q = 2'b10;
// This simple logic gate get turned into a function unit.
// The par program will map this into a CLB F or G unit.
and (out, Q[0], Q[1]);
// This creates a global clock buffer. Notice how I attach an
// attribute to the named gate to force it to be mapped to the
// desired XNF device. This device will not be pulled into the
// IOB associated with iclk because of the attribute.
buf gbuf(clk, iclk);
$attribute(gbuf, "XNF-LCA", "GCLK:O,I");
// This is mapped to a DFF. Since Q and D are two bits wide, the
// code generator actually makes two DFF devices that share a
// clock input.
always @(posedge clk) Q <= D;
// These attribute commands assign pins to the listed wires.
// This can be done to wires and registers, as internally both
// are treated as named signals.
$attribute(out, "PAD", "o150");
$attribute(i0, "PAD", "i152");
$attribute(i1, "PAD", "i153");
$attribute(iclk,"PAD", "i154");
endmodule /* main */
+1035
View File
File diff suppressed because it is too large Load Diff
+10 -8
View File
@@ -25,20 +25,22 @@
*
* Compile this program with the command:
*
* verilog hello.vl
*
* iverilog -ohello hello.vl
*
* After churning for a little while, the program will create the output
* file "hello" which is compiled, linked and ready to run. Run this
* program like so:
*
* ./hello
*
* and the program will print the message to its output. Easy!
*
* vvp hello
*
* and the program will print the message to its output. Easy! For
* more on how to make the iverilog command work, see the iverilog
* manual page.
*/
module main();
initial
initial
begin
$display("Hello, World");
$finish ;
+81
View File
@@ -0,0 +1,81 @@
/*
* Copyright (c) 2002 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: hello_vpi.c,v 1.5 2007/01/17 05:35:48 steve Exp $"
#endif
/*
* This file contains an example VPI module to demonstrate the tools
* to create vpi modules. To compile this module, use the iverilog-vpi
* command like so:
*
* iverilog-vpi hello_vpi.c
*
* The result is the hello_vpi.vpi module. See the hello_vpi.vl
* program for example Verilog code to call this module.
*/
# include <vpi_user.h>
static PLI_INT32 my_hello_calltf(char *xx)
{
vpi_printf("Hello World, from VPI.\n");
return 0;
}
static void my_hello_register()
{
s_vpi_systf_data tf_data;
tf_data.type = vpiSysTask;
tf_data.tfname = "$my_hello";
tf_data.calltf = my_hello_calltf;
tf_data.compiletf = 0;
tf_data.sizetf = 0;
vpi_register_systf(&tf_data);
}
/*
* This is a table of register functions. This table is the external
* symbol that the simulator looks for when loading this .vpi module.
*/
void (*vlog_startup_routines[])() = {
my_hello_register,
0
};
/*
* $Log: hello_vpi.c,v $
* Revision 1.5 2007/01/17 05:35:48 steve
* Fix typo is hello_vpi.c example.
*
* Revision 1.4 2006/10/30 22:46:25 steve
* Updates for Cygwin portability (pr1585922)
*
* Revision 1.3 2002/08/12 01:35:01 steve
* conditional ident string using autoconfig.
*
* Revision 1.2 2002/08/11 23:47:04 steve
* Add missing Log and Ident strings.
*
* Revision 1.1 2002/04/18 03:25:16 steve
* More examples.
*
*/
+49
View File
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2002 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*
* Here we have the canonical "Hello, World" program written in Verilog,
* with VPI. It uses the hello_vpi.vpi module that is compiled from
* the hello_vpi.c program also in this directory. See the
* hello_vpi.c for instructions on how to compile it.
*
* Compile this program with the command:
*
* iverilog -ohello_vpi hello_vpi.vl
*
* After churning for a little while, the program will create the output
* file "hello" which is compiled, linked and ready to run. Run this
* program like so:
*
* vvp -M. -mhello_vpi hello_vpi
*
* and the program will print the message to its output. Easy! For
* more on how to make the iverilog command work, see the iverilog
* manual page.
*/
module main();
initial
begin
$my_hello;
$finish ;
end
endmodule
+1 -1
View File
@@ -23,7 +23,7 @@
*
* To compile this for XNF, try a command like this:
*
* verilog -X -fpart=XC4010XLPQ160 -fncf=outff.ncf outff.v
* iverilog -txnf -ppart=XC4010XLPQ160 -ooutff.xnf -pncf=outff.ncf outff.v
*
* That command causes an outff.xnf and outff.ncf file to be created.
* Next, make the outff.ngd file with the command:
+121
View File
@@ -0,0 +1,121 @@
/*
* Copyright (c) 2000 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*
* This example shows how to use Icarus Verilog to generate PLD output.
* The design is intended to fit into a 22v10 in a PLCC package, with
* pin assignments locked down by design. The command to compile this
* into a jedec file is;
*
* iverilog -tpal -ppart=generic-22v10-plcc -opal_reg.jed pal_reg.v
*
* The output file name (passed through the -o<file> switch) can be
* any file you desire. If the compilation and fittin all succeed, the
* output file will be a JEDEC file that you can take to your favorite
* PROM programmer to program the part.
*
* This source demonstrates some important principles of synthesizing
* a design for a PLD, including how to specify synchronous logic, and
* how to assign signals to pins. The pin assignment in particular is
* part specific, and must be right for the fitting to succeed.
*/
/*
* The register module is an 8 bit register that copies the input to
* the output registers on the rising edge of the clk input. The
* always statement creates a simple d-type flip-flop that is loaded
* on the rising edge of the clock.
*
* The output drivers are controlled by a single active low output
* enable. I used bufif0 devices in this example, but the exact same
* thing can be achived with a continuous assignment like so:
*
* assign out = oe? 8'hzz : Q;
*
* Many people prefer the expression form. It is true that it does
* seem to express the intent a bit more clearly.
*/
module register (out, val, clk, oe);
output [7:0] out;
input [7:0] val;
input clk, oe;
reg [7:0] Q;
wire [7:0] out;
bufif0 drv[7:0](out, Q, oe);
always @(posedge clk) Q = val;
endmodule
/*
* The module pal is used to attach pin information to all the pins of
* the device. We use this to lock down the pin assignments of the
* synthesized result. The pin number assignments are for a 22v10 in
* a PLCC package.
*
* Note that this module has no logic in it. It is a convention I use
* that I put all the functionality in a seperate module (seen above)
* and isolate the Icarus Verilog specific $attribute madness into a
* top-level module. The advantage of this style is that the entire
* module can be `ifdef'ed out when doing simulation and you don't
* need to worry that functionality will be affected.
*/
module pal;
wire out7, out6, out5, out4, out3, out2, out1, out0;
wire inp7, inp6, inp5, inp4, inp3, inp2, inp1, inp0;
wire clk, oe;
// The PAD attributes attach the wires to pins of the
// device. Output pins are prefixed by a 'o', and input pins by an
// 'i'. If not all the available output pins are used, then the
// remaining are available for the synthesizer to drop internal
// registers or extra logic layers.
$attribute(out7, "PAD", "o27");
$attribute(out6, "PAD", "o26");
$attribute(out5, "PAD", "o25");
$attribute(out4, "PAD", "o24");
$attribute(out3, "PAD", "o23");
$attribute(out2, "PAD", "o21");
$attribute(out1, "PAD", "o20");
$attribute(out0, "PAD", "o19");
$attribute(inp7, "PAD", "i10");
$attribute(inp6, "PAD", "i9");
$attribute(inp5, "PAD", "i7");
$attribute(inp4, "PAD", "i6");
$attribute(inp3, "PAD", "i5");
$attribute(inp2, "PAD", "i4");
$attribute(inp1, "PAD", "i3");
$attribute(inp0, "PAD", "i2");
//$attribute(clk, "PAD", "CLK");
$attribute(oe, "PAD", "i13");
register dev({out7, out6, out5, out4, out3, out2, out1, out0},
{inp7, inp6, inp5, inp4, inp3, inp2, inp1, inp0},
clk, oe);
endmodule // pal
+13 -13
View File
@@ -20,36 +20,36 @@
/*
* This example program simulates a 16x1 ram, and is used as an
* example for using VCD output and waveform viewers.
*
*
* Like any other Verilog simulation, compile this program with the
* command:
*
* verilog show_vcd.vl
*
*
* iverilog show_vcd.vl
*
* This will generate the show_vcd command in the current directory.
* When you run the command, you will see the output from all the
* calls to $display, but also there will be a dump file ``show_vcd.vcd''.
* The name of this file is set by the statement:
*
* $dumpfile("show_vcd.vcd");
*
*
* in the main module. The output file uses the standard VCD file format
* so can be viewed using off-the-shelf waveform viewers. The remaining
* steps describe how to use GTKWave to view the file. If you are using
* a different viewer, see the documentation for that tool.
*
*
* To view the output generated by running show_vcd, start the GTKWave
* viewer with the command:
*
* wave show_vcd.vcd
*
*
* gtkwave show_vcd.vcd
*
* The GTKWave program will display its main window, and show in a small
* status box (upper left corner) that it succeeded in loading the dump
* file. However, there are no waveforms displayed yet. Select signals to
* add to the waveform display using the menu selection:
*
* "Search --> Signal Search Tree"
*
*
* This will bring up a dialog box that shows in directory tree format
* the signals of the program. Select the signals you wish to view, and
* click one of the buttons on the bottom of the dialog box to display
@@ -60,7 +60,7 @@
* $dumpvars system tasks. The $dumpfile task tells the simulation where
* to write the VCD output. This task must be called once before the
* $dumpvars task is called.
*
*
* The $dumpvars task tells the simulation what variables to write to
* the VCD output. The first parameter is how far to descend while
* scanning a scope, and the remaining paramters are signals or scope
@@ -77,7 +77,7 @@ module ram16x1 (q, d, a, we, wclk);
input wclk;
reg mem[15:0];
assign q = mem[a];
always @(posedge wclk) if (we) mem[a] = d;
@@ -88,7 +88,7 @@ module main;
reg d;
reg [3:0] a;
reg we, wclk;
ram16x1 r1 (q, d, a, we, wclk);
initial begin
+378
View File
@@ -0,0 +1,378 @@
/*
* Copyright (c) 2002 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: sqrt-virtex.v,v 1.5 2007/03/22 16:08:18 steve Exp $"
*/
/*
* This module is a synthesizeable square-root function. It is also a
* detailed example of how to target Xilinx Virtex parts using
* Icarus Verilog. In fact, for no particular reason other than to
* be excessively specific, I will step through the process of
* generating a design for a Spartan-II XC2S15-VQ100, and also how to
* generate a generic library part for larger Virtex designs.
*
* In addition to Icarus Verilog, you will need implementation
* software from Xilinx. As of this writing, this example was tested
* with Foundation 4.2i, but it should work the same with ISE and
* Webpack software.
*
* This example source contains all the Verilog needed to do
* everything described below. We use conditional compilation to
* select the bits of Verilog that are needed to perform each specific
* task.
*
* SIMULATE THE DESIGN
*
* This source file includes a simulation test bench. To compile the
* program to include this test bench, use the command line:
*
* iverilog -DSIMULATE=1 -oa.out sqrt-virtex.v
*
* This generates the file "a.out" that can then be executed with the
* command:
*
* vvp a.out
*
* This causes the simulation to run a long set of example sqrt
* calculations. Each result is checked by the test bench to assure
* that the result is valid. When it is done, the program prints
* "PASSED" and finishes the simulation.
*
* When you take a close look at the "main" module below, you will see
* that it uses Verilog constructs that are not synthesizeable. This
* is fine, as we will never try to synthesize it.
*
* LIBRARY PARTS
*
* One can use the sqrt32 module to generate an EDIF file suitable for
* use as a library part. This part can be imported to the Xilinx
* schematic editor, then placed like any other pre-existing
* macro. One can also pass the generated EDIF as a precompiled macro
* that other designers may use as they see fit.
*
* To make an EDIF file from the sqrt32 module, execute the command:
*
* iverilog -osqrt32.edf -tfpga -parch=virtex sqrt-virtex.v
*
* The -parch=virtex tells the code generator to generate code for the
* virtex architecture family (we don't yet care what specific part)
* and the -osqrt32.edf places the output into the file
* sqrt32.edf.
*
* Without any preprocessor directives, the only module is the sqrt32
* module, so sqrt32 is compiled as the root. The ports of the module
* are automatically made into ports of the sqrt32.edf netlist, and
* the contents of the sqrt32 module are connected approprately.
*
* COMPLETE CHIP DESIGNS
*
* To make a complete chip design, there are other bits that need to
* be accounted for. Signals must be assigned to pins, and some
* special devices may need to be created. We also want to write into
* the EDIF file complete part information so that the implementation
* tools know how to route the complete design. The command to compile
* for our target part is:
*
* iverilog -ochip.edf -tfpga \
* -parch=virtex -ppart=XC2S15-VQ100 \
* -DMAKE_CHIP=1 sqrt-virtex.v
*
* This command uses the "chip" module as the root. This module in
* turn has ports that are destined to be the pins of the completed
* part. The -ppart= option gives complete part information, that is
* in turn written into the EDIF file. This saves us the drudgery of
* repeating that part number for later commands.
*
* The next steps involve Xilinx software, and to talk to Xilinx
* software, the netlist must be in the form of an "ngd" file, a
* binary netlist format. The command:
*
* ngdbuild chip.edf chip.ngd
*
* does the trick. The input to ngdbuild is the chip.edf file created
* by Icarus Verilog, and the output is the chip.ngd file that the
* implementation tools may read. From this point, it is best to refer
* to Xilinx documentation for the software you are using, but the
* quick summary is:
*
* map -o map.ncd chip.ngd
* par -w map.ncd chip.ncd
*
* The result of this sequence of commands is the chip.ncd file that
* is ready to be viewed by FPGA Edit, or converted to a bit stream,
* or whatever.
*
* POST MAP SIMULATION
*
* Warm fuzzies are good, and retesting your design after the part
* is mapped by the Xilinx backend tools is a cheap source of fuzzies.
* The command to make a Verilog file out of the mapped design is:
*
* ngd2ver chip.ngd chip_root.v
*
* This command creates from the chip.ngd the file "chip_root.v" that
* contains Verilog code that simulates the mapped design. This output
* Verilog has the single root module "chip_root", which came from the
* name of the root module when we were making the EDIF file in the
* first place. The module has ports named just line the ports of the
* chip_root module below.
*
* The generated Verilog uses the library in the directory
* $(XILINX)/verilog/src/simprims. This directory comes with the ISE
* WebPACK installation that you are using. Icarus Verilog is able to
* simulate using that library.
*
* To compile a post-map simulation of the chip_root.v, use the
* command:
*
* iverilog -DSIMULATE -DPOST_MAP -ob.out \
* -y $(XILINX)/verilog/src/simprims \
* sqrt-virtex.v chip_root.v \
* $(XILINX)/verilog/src/glbl.v
*
* This command line generates b.out from the source files
* sqrt-virtex.v and chip_root.v (the latter from ngd2ver)
* and the "-y <path>" flag specifies the library directory that will
* be needed. The glbl.v source file is also included to provide the
* GSR and related signals.
*
* The POST_MAP compiler directive causes the GSR manipulations
* included in the test bench to be compiled in, to simulate the chip
* startup. Other then that, the test bench runs the post-map design
* the same way the pre-synthesis design works.
*
* Run this design with the command:
*
* vvp b.out
*
* And there you go.
*/
`ifndef POST_MAP
/*
* This module approximates the square root of an unsigned 32bit
* number. The algorithm works by doing a bit-wise binary search.
* Starting from the most significant bit, the accumulated value
* tries to put a 1 in the bit position. If that makes the square
* too big for the input, the bit is left zero, otherwise it is set
* in the result. This continues for each bit, decreasing in
* significance, until all the bits are calculated or all the
* remaining bits are zero.
*
* Since the result is an integer, this function really calculates
* value of the expression:
*
* x = floor(sqrt(y))
*
* where sqrt(y) is the exact square root of y and floor(N) is the
* largest integer <= N.
*
* For 32 bit numbers, this will never run more than 16 iterations,
* which amounts to 16 clocks.
*/
module sqrt32(clk, rdy, reset, x, .y(acc));
input clk;
output rdy;
input reset;
input [31:0] x;
output [15:0] acc;
// acc holds the accumulated result, and acc2 is the accumulated
// square of the accumulated result.
reg [15:0] acc;
reg [31:0] acc2;
// Keep track of which bit I'm working on.
reg [4:0] bitl;
wire [15:0] bit = 1 << bitl;
wire [31:0] bit2 = 1 << (bitl << 1);
// The output is ready when the bitl counter underflows.
wire rdy = bitl[4];
// guess holds the potential next values for acc, and guess2 holds
// the square of that guess. The guess2 calculation is a little bit
// subtle. The idea is that:
//
// guess2 = (acc + bit) * (acc + bit)
// = (acc * acc) + 2*acc*bit + bit*bit
// = acc2 + 2*acc*bit + bit2
// = acc2 + 2 * (acc<<bitl) + bit
//
// This works out using shifts because bit and bit2 are known to
// have only a single bit in them.
wire [15:0] guess = acc | bit;
wire [31:0] guess2 = acc2 + bit2 + ((acc << bitl) << 1);
(* ivl_synthesis_on *)
always @(posedge clk or posedge reset)
if (reset) begin
acc = 0;
acc2 = 0;
bitl = 15;
end else begin
if (guess2 <= x) begin
acc <= guess;
acc2 <= guess2;
end
bitl <= bitl - 5'd1;
end
endmodule // sqrt32
`endif // `ifndef POST_MAP
`ifdef SIMULATE
/*
* This module is a test bench for the sqrt32 module. It runs some
* test input values through the sqrt32 module, and checks that the
* output is valid. If an invalid output is generated, print and
* error message and stop immediately. If all the tested values pass,
* then print PASSED after the test is complete.
*/
module main;
reg [31:0] x;
reg clk, reset;
wire [15:0] y;
wire rdy;
`ifdef POST_MAP
chip_root dut(.clk(clk), .reset(reset), .rdy(rdy), .x(x), .y(y));
`else
sqrt32 dut(.clk(clk), .reset(reset), .rdy(rdy), .x(x), .y(y));
`endif
(* ivl_synthesis_off *)
always #5 clk = !clk;
task reset_dut;
begin
reset = 1;
@(posedge clk) ;
#1 reset = 0;
@(negedge clk) ;
end
endtask // reset_dut
task crank_dut;
begin
while (rdy == 0) begin
@(posedge clk) /* wait */;
end
end
endtask // crank_dut
`ifdef POST_MAP
reg GSR;
assign glbl.GSR = GSR;
`endif
integer idx;
(* ivl_synthesis_off *)
initial begin
reset = 0;
clk = 0;
/* If doing a post-map simulation, when we need to wiggle
The GSR bit to simulate chip power-up. */
`ifdef POST_MAP
GSR = 1;
#100 GSR = 0;
`endif
#100 x = 1;
reset_dut;
crank_dut;
$display("x=%d, y=%d", x, y);
x = 3;
reset_dut;
crank_dut;
$display("x=%d, y=%d", x, y);
x = 4;
reset_dut;
crank_dut;
$display("x=%d, y=%d", x, y);
for (idx = 0 ; idx < 200 ; idx = idx + 1) begin
x = $random;
reset_dut;
crank_dut;
$display("x=%d, y=%d", x, y);
if (x < (y * y)) begin
$display("ERROR: y is too big");
$finish;
end
if (x > ((y + 1)*(y + 1))) begin
$display("ERROR: y is too small");
$finish;
end
end
$display("PASSED");
$finish;
end
endmodule // main
`endif
`ifdef MAKE_CHIP
/*
* This module represents the chip packaging that we intend to
* generate. We bind pins here, and route the clock to the global
* clock buffer.
*/
module chip_root(clk, rdy, reset, x, y);
input clk;
output rdy;
input reset;
input [31:0] x;
output [15:0] y;
wire clk_int;
(* cellref="BUFG:O,I" *)
buf gbuf (clk_int, clk);
sqrt32 dut(.clk(clk_int), .reset(reset), .rdy(rdy), .x(x), .y(y));
/* Assign the clk to GCLK0, which is on pin P39. */
$attribute(clk, "PAD", "P39");
// We don't care where the remaining pins go, so set the pin number
// to 0. This tells the implementation tools that we want a PAD,
// but we don't care which. Also note the use of a comma (,)
// separated list to assign pins to the bits of a vector.
$attribute(rdy, "PAD", "0");
$attribute(reset, "PAD", "0");
$attribute(x, "PAD", "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0");
$attribute(y, "PAD", "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0");
endmodule // chip_root
`endif
+20 -7
View File
@@ -16,9 +16,22 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: sqrt.vl,v 1.1 1999/12/05 21:08:56 steve Exp $"
* $Id: sqrt.vl,v 1.5 2007/03/22 16:08:18 steve Exp $"
*/
/*
* This example shows that Icarus Verilog can run non-trivial
* programs, too. This uses a variety of Verilog language features
* to implement the module of a square-root device. The program
* uses IEEE1364-1995 language features and should work correctly
* on any Verilog compiler.
*
* Run the file with Icarus Verilog under UNIX using the command:
*
* % iverilog -osqrt sqrt.v
* % ./sqrt
*/
/*
* This module approximates the square root of an unsigned 32bit
* number. The algorithm works by doing a bit-wise binary search.
@@ -37,7 +50,7 @@
* where sqrt(y) is the exact square root of y and floor(N) is the
* largest integer <= N.
*
* For 32bit numbers, this will never run more then 16 iterations,
* For 32 bit numbers, this will never run more than 16 iterations,
* which amounts to 16 clocks.
*/
@@ -84,8 +97,8 @@ module sqrt32(clk, rdy, reset, x, .y(acc));
bitl = 15;
end
endtask
initial clear;
initial clear;
always @(reset or posedge clk)
if (reset)
@@ -108,19 +121,19 @@ module main;
wire rdy;
sqrt32 root(.clk(clk), .rdy(rdy), .reset(reset), .x(value), .y(result));
always #5 clk = ~clk;
always @(posedge rdy) begin
$display("sqrt(%d) --> %d", value, result);
$finish;
end
initial begin
clk = 0;
reset = 1;
$monitor($time,,"%m = %b", root.acc, root.acc);
$monitor($time,,"%m.acc = %b", root.acc);
#100 value = 63;
reset = 0;
end
+7 -6
View File
@@ -25,10 +25,11 @@
*
* To compile this for XNF, try a command like this:
*
* verilog -X -fpart=XC4010XLPQ160 -fncf=xnf_add.ncf xnf_add.v
* iverilog -txnf -ppart=XC4010XLPQ160 -pncf=xnf_add.ncf -oxnf_add.xnf xnf_add.v
*
* That command causes an xnf_add.xnf and xnf_add.ncf file to be created.
* Next, make the xnf_add.ngd file with the command:
* Next, Use Xilinx Alliance or Foundation tools to make the xnf_add.ngd
* file with the command:
*
* xnf2ngd -l xilinxun -u xnf_add.xnf xnf_add.ngo
* ngdbuild xnf_add.ngo xnf_add.ngd
@@ -40,8 +41,8 @@
* map -o map.ncd xnf_add.ngd
* par -w map.ncd xnf_add.ncd
*
* At this point, you can use the FPGA Editor to edit the xnf_add.ncd
* file to see the carry chains made up to support the adder.
* At this point, you can use the Xilinx FPGA Editor to edit the xnf_add.ncd
* file and see the carry chains made up to support the adder.
*/
module main;
@@ -71,8 +72,8 @@ module main;
// These attribute commands assign pins to the listed wires.
// This can be done to wires and registers, as internally both
// are treated as named signals. It doesn't work (yet) on vectors,
// though, so break out the vectors with scaler assignments.
// though, so break out the vectors with scalar assignments.
assign a[0] = a0;
assign a[1] = a1;
assign a[2] = a2;
+54
View File
@@ -0,0 +1,54 @@
/*
* Copyright (c) 1999 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
// This example describes a 16x1 RAM that can be synthesized into
// a CLB ram in a Xilinx FPGA.
module ram16x1 (q, d, a, we, wclk);
output q;
input d;
input [3:0] a;
input we;
input wclk;
reg mem[15:0];
assign q = mem[a];
always @(posedge wclk) if (we) mem[a] = d;
endmodule /* ram16x1 */
module main;
wire q;
reg d;
reg [3:0] a;
reg we, wclk;
ram16x1 r1 (q, d, a, we, wclk);
initial begin
$monitor("q = %b", q);
d = 0;
wclk = 0;
a = 5;
we = 1;
#1 wclk = 1;
#1 wclk = 0;
end
endmodule /* main */
+834 -167
View File
File diff suppressed because it is too large Load Diff
+84
View File
@@ -0,0 +1,84 @@
Icarus Verilog Extensions
Icarus Verilog supports certain extensions to the baseline IEEE1364
standard. Some of these are picked from extended variants of the
language, such as SystemVerilog, and some are expressions of internal
behavior of Icarus Verilog, made available as a tool debugging aid.
* Builtin System Functions
** Extended Verilog Data Types
This feature is turned off if the generation flag "-g" is set to other
then the default "2x". For example, "iverilog -g2x" enables extended
data types, and "iverilog -g2" disables them.
Icarus Verilog adds support for extended data types. This extended
type syntax is based on a proposal by Cadence Design Systems,
originally as an update to the IEEE1364. That original proposal has
apparently been absorbed by the IEEE1800 SystemVerilog
standard. Icarus Verilog currently only takes the new primitive types
from the proposal.
Extended data types separates the concept of net/variable from the
data type. Both nets and variables can declared with any data
type. The primitive types available are:
logic - The familiar 0, 1, x and z, optionally with strength.
bool - Limited to only 0 and 1
real - 64bit real values
Nets with logic type may have multiple drivers with strength, and the
value is resolved the usual way. Only logic values may be driven to
logic nets, so bool values driven onto logic nets are implicitly
converted to logic.
Nets with any other type may not have multiple drivers. The compiler
should detect the multiple drivers and report an error.
- Declarations
The declaration of a net is extended to include the type of the wire,
with the syntax:
wire <type> <wire-assignment-list>... ;
The <type>, if omitted, is taken to be logic. The "wire" can be any of
the net keywords. Wires can be logic, bool, real, or vectors of logic
or bool. Some valid examples:
wire real foo = 1.0;
tri logic bus[31:0];
wire bool addr[23:0];
... and so on.
The declarations of variables is similar. The "reg" keyword is used to
specify that this is a variable. Variables can have the same data
types as nets.
- Ports
Module and task ports in standard verilog are restricted to logic
types. This extension removes that restriction, allowing any type to
pass through the port consistent with the continuous assignment
connectivity that is implied by the type.
- Expressions
Expressions in the face of real values is covered by the baseline
Verilog standard.
The bool type supports the same operators as the logic type, with the
obvious differences imposed by the limited domain.
Comparison operators (not case compare) return logic if either of
their operands is logic. If both are bool or real (including mix of
bool and real) then the result is bool. This is because comparison of
bools and reals always return exactly true or false.
Case comparison returns bool. This differs from baseline Verilog,
which strictly speaking returns a logic, but only 0 or 1 values.
All the arithmetic operators return bool if both of their operands are
bool or real. Otherwise, they return logic.

Some files were not shown because too many files have changed in this diff Show More