2000-09-18 03:24:32 +02:00
|
|
|
#ifndef __t_dll_H
|
|
|
|
|
#define __t_dll_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
|
|
|
|
|
*/
|
|
|
|
|
#if !defined(WINNT) && !defined(macintosh)
|
2001-05-09 01:59:33 +02:00
|
|
|
#ident "$Id: t-dll.h,v 1.43 2001/05/08 23:59:33 steve Exp $"
|
2000-09-18 03:24:32 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
# include "target.h"
|
|
|
|
|
# include "ivl_target.h"
|
|
|
|
|
|
2000-12-15 06:45:25 +01:00
|
|
|
#if 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
|
|
|
|
|
|
2000-09-30 04:18:15 +02:00
|
|
|
struct ivl_design_s {
|
2000-10-08 06:01:54 +02:00
|
|
|
|
2000-09-30 04:18:15 +02:00
|
|
|
ivl_scope_t root_;
|
2000-10-08 06:01:54 +02:00
|
|
|
|
|
|
|
|
ivl_process_t threads_;
|
|
|
|
|
|
2000-09-30 04:18:15 +02:00
|
|
|
const Design*self;
|
|
|
|
|
};
|
|
|
|
|
|
2000-09-18 03:24:32 +02:00
|
|
|
/*
|
|
|
|
|
* The DLL target type loads a named object file to handle the process
|
|
|
|
|
* of scanning the netlist. When it is time to start the design, I
|
|
|
|
|
* locate and link in the desired DLL, then start calling methods. The
|
|
|
|
|
* DLL will call me back to get information out of the netlist in
|
|
|
|
|
* particular.
|
|
|
|
|
*/
|
2000-09-23 07:15:07 +02:00
|
|
|
struct dll_target : public target_t, public expr_scan_t {
|
2000-09-18 03:24:32 +02:00
|
|
|
|
|
|
|
|
bool start_design(const Design*);
|
2001-03-27 05:31:06 +02:00
|
|
|
int end_design(const Design*);
|
2000-09-18 03:24:32 +02:00
|
|
|
|
|
|
|
|
bool bufz(const NetBUFZ*);
|
|
|
|
|
void event(const NetEvent*);
|
|
|
|
|
void logic(const NetLogic*);
|
2001-04-23 01:09:45 +02:00
|
|
|
void udp(const NetUDP*);
|
2000-11-11 01:03:36 +01:00
|
|
|
void lpm_ff(const NetFF*);
|
2001-04-26 07:12:02 +02:00
|
|
|
void lpm_mux(const NetMux*);
|
2000-10-21 18:49:45 +02:00
|
|
|
void net_assign(const NetAssign_*);
|
2000-09-18 03:24:32 +02:00
|
|
|
bool net_const(const NetConst*);
|
|
|
|
|
void net_probe(const NetEvProbe*);
|
|
|
|
|
|
|
|
|
|
bool process(const NetProcTop*);
|
|
|
|
|
void scope(const NetScope*);
|
|
|
|
|
void signal(const NetNet*);
|
2001-05-09 01:59:33 +02:00
|
|
|
void memory(const NetMemory*);
|
2000-09-18 03:24:32 +02:00
|
|
|
|
2000-12-15 06:45:25 +01:00
|
|
|
ivl_dll_t dll_;
|
2000-09-18 03:24:32 +02:00
|
|
|
string dll_path_;
|
|
|
|
|
|
2000-09-30 04:18:15 +02:00
|
|
|
ivl_design_s des_;
|
2000-09-18 03:24:32 +02:00
|
|
|
|
2000-10-21 18:49:45 +02:00
|
|
|
target_design_f target_;
|
2000-09-18 03:24:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* These methods and members are used for forming the
|
|
|
|
|
statements of a thread. */
|
|
|
|
|
struct ivl_statement_s*stmt_cur_;
|
|
|
|
|
void proc_assign(const NetAssign*);
|
2001-05-09 01:59:33 +02:00
|
|
|
void proc_assign_mem(const NetAssignMem*);
|
2001-04-03 06:50:37 +02:00
|
|
|
void proc_assign_nb(const NetAssignNB*);
|
2001-05-09 01:59:33 +02:00
|
|
|
void proc_assign_mem_nb(const NetAssignMemNB*net);
|
2000-09-18 03:24:32 +02:00
|
|
|
bool proc_block(const NetBlock*);
|
2001-03-31 19:36:38 +02:00
|
|
|
void proc_case(const NetCase*);
|
2000-09-18 03:24:32 +02:00
|
|
|
void proc_condit(const NetCondit*);
|
|
|
|
|
bool proc_delay(const NetPDelay*);
|
2001-04-07 21:24:36 +02:00
|
|
|
bool proc_disable(const NetDisable*);
|
2001-04-04 06:50:35 +02:00
|
|
|
void proc_forever(const NetForever*);
|
2001-04-05 05:20:57 +02:00
|
|
|
void proc_repeat(const NetRepeat*);
|
2000-09-19 06:15:27 +02:00
|
|
|
void proc_stask(const NetSTask*);
|
2000-09-26 02:30:07 +02:00
|
|
|
bool proc_trigger(const NetEvTrig*);
|
2001-04-02 04:28:12 +02:00
|
|
|
void proc_utask(const NetUTask*);
|
2000-09-18 03:24:32 +02:00
|
|
|
bool proc_wait(const NetEvWait*);
|
|
|
|
|
void proc_while(const NetWhile*);
|
|
|
|
|
|
2001-04-06 04:28:02 +02:00
|
|
|
void func_def(const NetScope*);
|
2001-04-02 04:28:12 +02:00
|
|
|
void task_def(const NetScope*);
|
|
|
|
|
|
2000-09-23 07:15:07 +02:00
|
|
|
struct ivl_expr_s*expr_;
|
2000-09-30 04:18:15 +02:00
|
|
|
void expr_binary(const NetEBinary*);
|
2000-10-28 19:55:03 +02:00
|
|
|
void expr_concat(const NetEConcat*);
|
2001-05-09 01:59:33 +02:00
|
|
|
void expr_memory(const NetEMemory*);
|
2000-09-24 04:21:53 +02:00
|
|
|
void expr_const(const NetEConst*);
|
2001-04-02 02:28:35 +02:00
|
|
|
void expr_scope(const NetEScope*);
|
2000-10-05 07:03:01 +02:00
|
|
|
void expr_sfunc(const NetESFunc*);
|
2001-04-06 04:28:02 +02:00
|
|
|
void expr_ufunc(const NetEUFunc*);
|
2001-03-29 04:52:39 +02:00
|
|
|
void expr_unary(const NetEUnary*);
|
2000-09-24 04:21:53 +02:00
|
|
|
void expr_signal(const NetESignal*);
|
2001-03-20 02:44:13 +01:00
|
|
|
|
|
|
|
|
ivl_scope_t lookup_scope_(const NetScope*scope);
|
2001-05-09 01:59:33 +02:00
|
|
|
ivl_memory_t lookup_memory_(const NetMemory*mem);
|
2000-09-23 07:15:07 +02:00
|
|
|
};
|
2000-09-18 03:24:32 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* These are various private declarations used by the t-dll target.
|
|
|
|
|
*/
|
|
|
|
|
|
2001-03-28 08:07:39 +02:00
|
|
|
struct ivl_event_s {
|
|
|
|
|
char*name;
|
|
|
|
|
ivl_scope_t scope;
|
2001-04-01 03:48:21 +02:00
|
|
|
unsigned short nany, nneg, npos;
|
2001-03-28 08:07:39 +02:00
|
|
|
ivl_nexus_t*pins;
|
|
|
|
|
};
|
|
|
|
|
|
2000-09-24 04:21:53 +02:00
|
|
|
/*
|
|
|
|
|
* The ivl_expr_t is an opaque reference to one of these
|
|
|
|
|
* structures. This structure holds all the information we need about
|
|
|
|
|
* an expression node, including its type, the expression width, and
|
|
|
|
|
* type specific properties.
|
|
|
|
|
*/
|
2000-09-23 07:15:07 +02:00
|
|
|
struct ivl_expr_s {
|
|
|
|
|
ivl_expr_type_t type_;
|
2000-09-26 02:30:07 +02:00
|
|
|
|
|
|
|
|
unsigned width_ :24;
|
|
|
|
|
unsigned signed_ : 1;
|
2000-09-23 07:15:07 +02:00
|
|
|
|
|
|
|
|
union {
|
2000-09-30 04:18:15 +02:00
|
|
|
struct {
|
|
|
|
|
char op_;
|
|
|
|
|
ivl_expr_t lef_;
|
|
|
|
|
ivl_expr_t rig_;
|
|
|
|
|
} binary_;
|
|
|
|
|
|
2000-10-29 00:32:34 +02:00
|
|
|
struct {
|
|
|
|
|
unsigned rept :16;
|
|
|
|
|
unsigned parms :16;
|
|
|
|
|
ivl_expr_t*parm;
|
|
|
|
|
} concat_;
|
|
|
|
|
|
2000-09-26 02:30:07 +02:00
|
|
|
struct {
|
|
|
|
|
char*bits_;
|
|
|
|
|
} number_;
|
|
|
|
|
|
2001-04-02 02:28:35 +02:00
|
|
|
struct {
|
|
|
|
|
ivl_scope_t scope;
|
|
|
|
|
} scope_;
|
|
|
|
|
|
2000-10-05 07:03:01 +02:00
|
|
|
struct {
|
|
|
|
|
char*name_;
|
|
|
|
|
} sfunc_;
|
|
|
|
|
|
2000-09-23 07:15:07 +02:00
|
|
|
struct {
|
|
|
|
|
char*value_;
|
|
|
|
|
} string_;
|
2000-09-24 04:21:53 +02:00
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
char*name_;
|
|
|
|
|
ivl_expr_t msb_;
|
|
|
|
|
ivl_expr_t lsb_;
|
|
|
|
|
} subsig_;
|
2001-03-29 04:52:39 +02:00
|
|
|
|
2001-05-06 19:48:20 +02:00
|
|
|
struct {
|
|
|
|
|
ivl_memory_t mem_;
|
|
|
|
|
ivl_expr_t idx_;
|
|
|
|
|
} memory_;
|
|
|
|
|
|
2001-04-06 04:28:02 +02:00
|
|
|
struct {
|
|
|
|
|
ivl_scope_t def;
|
|
|
|
|
ivl_expr_t *parm;
|
|
|
|
|
unsigned short parms;
|
|
|
|
|
} ufunc_;
|
|
|
|
|
|
2001-04-15 04:58:11 +02:00
|
|
|
struct {
|
|
|
|
|
unsigned long value;
|
|
|
|
|
} ulong_;
|
|
|
|
|
|
2001-03-29 04:52:39 +02:00
|
|
|
struct {
|
|
|
|
|
char op_;
|
|
|
|
|
ivl_expr_t sub_;
|
|
|
|
|
} unary_;
|
|
|
|
|
|
2000-09-23 07:15:07 +02:00
|
|
|
} u_;
|
|
|
|
|
};
|
2000-09-18 03:24:32 +02:00
|
|
|
|
2000-11-11 01:03:36 +01:00
|
|
|
/*
|
2001-04-26 07:12:02 +02:00
|
|
|
* LPM devices are handled by this suite of types. The ivl_lpm_s
|
|
|
|
|
* structure holds the core, including a type code, the object name
|
|
|
|
|
* and scope. The other properties of the device are held in the type
|
|
|
|
|
* specific member of the union.
|
2000-11-11 01:03:36 +01:00
|
|
|
*/
|
2001-04-26 07:12:02 +02:00
|
|
|
|
2000-11-11 01:03:36 +01:00
|
|
|
struct ivl_lpm_s {
|
|
|
|
|
ivl_lpm_type_t type;
|
|
|
|
|
ivl_scope_t scope;
|
|
|
|
|
char* name;
|
|
|
|
|
|
|
|
|
|
union {
|
2001-04-26 07:12:02 +02:00
|
|
|
struct ivl_lpm_ff_s {
|
|
|
|
|
unsigned short width;
|
|
|
|
|
ivl_nexus_t clk;
|
|
|
|
|
union {
|
|
|
|
|
ivl_nexus_t*pins;
|
|
|
|
|
ivl_nexus_t pin;
|
|
|
|
|
} q;
|
|
|
|
|
union {
|
|
|
|
|
ivl_nexus_t*pins;
|
|
|
|
|
ivl_nexus_t pin;
|
|
|
|
|
} d;
|
|
|
|
|
} ff;
|
|
|
|
|
|
|
|
|
|
struct ivl_lpm_mux_s {
|
|
|
|
|
unsigned short width;
|
|
|
|
|
unsigned short size;
|
|
|
|
|
unsigned short swid;
|
|
|
|
|
ivl_nexus_t*d;
|
|
|
|
|
union {
|
|
|
|
|
ivl_nexus_t*pins;
|
|
|
|
|
ivl_nexus_t pin;
|
|
|
|
|
} q;
|
|
|
|
|
union {
|
|
|
|
|
ivl_nexus_t*pins;
|
|
|
|
|
ivl_nexus_t pin;
|
|
|
|
|
} s;
|
|
|
|
|
} mux;
|
|
|
|
|
|
|
|
|
|
} u_;
|
2000-11-11 01:03:36 +01:00
|
|
|
};
|
|
|
|
|
|
2000-10-18 22:04:39 +02:00
|
|
|
/*
|
|
|
|
|
* This object contains references to ivl_nexus_t objects that in turn
|
|
|
|
|
* are reg nets. This is used by the assignment to represent the
|
|
|
|
|
* l-value expressions.
|
|
|
|
|
*/
|
2001-05-09 01:59:33 +02:00
|
|
|
|
|
|
|
|
enum ivl_lval_type_t {
|
|
|
|
|
IVL_LVAL_REG = 0,
|
|
|
|
|
IVL_LVAL_MUX = 1,
|
|
|
|
|
IVL_LVAL_MEM = 2,
|
|
|
|
|
};
|
|
|
|
|
|
2000-10-18 22:04:39 +02:00
|
|
|
struct ivl_lval_s {
|
|
|
|
|
unsigned width_ :24;
|
2001-05-09 01:59:33 +02:00
|
|
|
unsigned type_ : 8;
|
|
|
|
|
ivl_expr_t idx;
|
2000-10-18 22:04:39 +02:00
|
|
|
union {
|
|
|
|
|
ivl_nexus_t*pins_;
|
|
|
|
|
ivl_nexus_t pin_;
|
2001-05-09 01:59:33 +02:00
|
|
|
ivl_memory_t mem_;
|
2000-10-18 22:04:39 +02:00
|
|
|
} n;
|
|
|
|
|
};
|
|
|
|
|
|
2000-10-07 01:46:50 +02:00
|
|
|
/*
|
|
|
|
|
* This object represents a vector constant, possibly signed, in a
|
|
|
|
|
* structural context.
|
|
|
|
|
*/
|
2000-09-18 03:24:32 +02:00
|
|
|
struct ivl_net_const_s {
|
2000-10-05 07:03:01 +02:00
|
|
|
unsigned width_ :24;
|
|
|
|
|
unsigned signed_ : 1;
|
2000-10-07 01:46:50 +02:00
|
|
|
|
|
|
|
|
union {
|
|
|
|
|
char bit_[sizeof(char*)];
|
|
|
|
|
char *bits_;
|
|
|
|
|
} b;
|
|
|
|
|
|
|
|
|
|
union {
|
|
|
|
|
ivl_nexus_t pin_;
|
|
|
|
|
ivl_nexus_t*pins_;
|
|
|
|
|
} n;
|
2000-09-18 03:24:32 +02:00
|
|
|
};
|
|
|
|
|
|
2000-10-07 01:46:50 +02:00
|
|
|
/*
|
|
|
|
|
* Logic gates (just about everything that has a single output) are
|
|
|
|
|
* represented structurally by instances of this object.
|
|
|
|
|
*/
|
2000-09-18 03:24:32 +02:00
|
|
|
struct ivl_net_logic_s {
|
2000-10-07 01:46:50 +02:00
|
|
|
ivl_logic_t type_;
|
2001-04-23 01:09:45 +02:00
|
|
|
ivl_udp_t udp;
|
2000-10-15 06:46:23 +02:00
|
|
|
|
|
|
|
|
char* name_;
|
|
|
|
|
ivl_scope_t scope_;
|
|
|
|
|
|
2000-10-07 01:46:50 +02:00
|
|
|
unsigned npins_;
|
|
|
|
|
ivl_nexus_t*pins_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2001-04-23 01:09:45 +02:00
|
|
|
/*
|
|
|
|
|
* UDP definition.
|
|
|
|
|
*/
|
|
|
|
|
struct ivl_udp_s {
|
|
|
|
|
char* name;
|
|
|
|
|
unsigned nin;
|
|
|
|
|
unsigned short sequ;
|
|
|
|
|
char init;
|
|
|
|
|
unsigned nrows;
|
|
|
|
|
char **table; // zero terminated array of pointers
|
|
|
|
|
};
|
|
|
|
|
|
2000-10-08 06:01:54 +02:00
|
|
|
/*
|
|
|
|
|
* The ivl_nexus_t is a single-bit link of some number of pins of
|
|
|
|
|
* devices. the __nexus_ptr structure is a helper that actually does
|
|
|
|
|
* the pointing.
|
2001-04-30 01:17:38 +02:00
|
|
|
*
|
|
|
|
|
* The type_ member specifies which of the object pointers in the
|
|
|
|
|
* union are valid.
|
|
|
|
|
*
|
|
|
|
|
* The drive01 members gives the strength of the drive that the device
|
|
|
|
|
* is applying to the nexus, with 0 HiZ and 3 supply. If the pin is an
|
|
|
|
|
* input to the device, then the drives are both HiZ.
|
2000-10-08 06:01:54 +02:00
|
|
|
*/
|
2000-10-15 06:46:23 +02:00
|
|
|
struct ivl_nexus_ptr_s {
|
2000-10-08 06:01:54 +02:00
|
|
|
unsigned pin_ :24;
|
|
|
|
|
unsigned type_ : 8;
|
2001-04-30 01:17:38 +02:00
|
|
|
unsigned drive0 : 3;
|
|
|
|
|
unsigned drive1 : 3;
|
2000-10-08 06:01:54 +02:00
|
|
|
union {
|
|
|
|
|
ivl_signal_t sig; /* type 0 */
|
|
|
|
|
ivl_net_logic_t log; /* type 1 */
|
2000-10-13 05:39:27 +02:00
|
|
|
ivl_net_const_t con; /* type 2 */
|
2000-12-05 07:29:33 +01:00
|
|
|
ivl_lpm_t lpm; /* type 3 */
|
2000-10-08 06:01:54 +02:00
|
|
|
} l;
|
|
|
|
|
};
|
|
|
|
|
# define __NEXUS_PTR_SIG 0
|
|
|
|
|
# define __NEXUS_PTR_LOG 1
|
2000-10-13 05:39:27 +02:00
|
|
|
# define __NEXUS_PTR_CON 2
|
2000-12-05 07:29:33 +01:00
|
|
|
# define __NEXUS_PTR_LPM 3
|
2000-10-08 06:01:54 +02:00
|
|
|
|
2000-10-07 01:46:50 +02:00
|
|
|
struct ivl_nexus_s {
|
2000-10-08 06:01:54 +02:00
|
|
|
unsigned nptr_;
|
2000-10-15 06:46:23 +02:00
|
|
|
struct ivl_nexus_ptr_s*ptrs_;
|
2000-10-08 06:01:54 +02:00
|
|
|
char*name_;
|
2000-09-18 03:24:32 +02:00
|
|
|
};
|
|
|
|
|
|
2001-05-06 19:48:20 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Memory.
|
|
|
|
|
*/
|
|
|
|
|
struct ivl_memory_s {
|
|
|
|
|
char*name_;
|
|
|
|
|
ivl_scope_t scope_;
|
|
|
|
|
unsigned width_ :24;
|
|
|
|
|
unsigned signed_ : 1;
|
|
|
|
|
unsigned size_;
|
|
|
|
|
int root_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2000-10-07 01:46:50 +02:00
|
|
|
/*
|
|
|
|
|
* All we know about a process it its type (initial or always) and the
|
2001-03-20 02:44:13 +01:00
|
|
|
* single statement that is it. A process also has a scope, although
|
|
|
|
|
* that generally only matters for VPI calls.
|
2000-10-07 01:46:50 +02:00
|
|
|
*/
|
2000-09-18 03:24:32 +02:00
|
|
|
struct ivl_process_s {
|
|
|
|
|
ivl_process_type_t type_;
|
2001-03-20 02:44:13 +01:00
|
|
|
ivl_scope_t scope_;
|
2000-09-18 03:24:32 +02:00
|
|
|
ivl_statement_t stmt_;
|
2000-10-08 06:01:54 +02:00
|
|
|
|
|
|
|
|
ivl_process_t next_;
|
2000-09-18 03:24:32 +02:00
|
|
|
};
|
|
|
|
|
|
2000-10-07 01:46:50 +02:00
|
|
|
/*
|
|
|
|
|
* Scopes are kept in a tree. Each scope points to its first child,
|
|
|
|
|
* and also to any siblings. Thus a parent can scan all its children
|
|
|
|
|
* by following its child pointer then following sibling pointers from
|
|
|
|
|
* there.
|
|
|
|
|
*/
|
2000-09-30 04:18:15 +02:00
|
|
|
struct ivl_scope_s {
|
|
|
|
|
ivl_scope_t child_, sibling_;
|
|
|
|
|
|
2000-10-08 06:01:54 +02:00
|
|
|
char* name_;
|
2001-01-15 01:47:01 +01:00
|
|
|
const char* tname_;
|
|
|
|
|
ivl_scope_type_t type_;
|
2000-10-07 01:46:50 +02:00
|
|
|
|
|
|
|
|
unsigned nsigs_;
|
|
|
|
|
ivl_signal_t*sigs_;
|
2000-10-07 21:45:42 +02:00
|
|
|
|
|
|
|
|
unsigned nlog_;
|
|
|
|
|
ivl_net_logic_t*log_;
|
2000-11-11 01:03:36 +01:00
|
|
|
|
2001-03-28 08:07:39 +02:00
|
|
|
unsigned nevent_;
|
|
|
|
|
ivl_event_t* event_;
|
|
|
|
|
|
2000-11-11 01:03:36 +01:00
|
|
|
unsigned nlpm_;
|
|
|
|
|
ivl_lpm_t* lpm_;
|
2001-04-02 04:28:12 +02:00
|
|
|
|
2001-05-09 01:59:33 +02:00
|
|
|
unsigned nmem_;
|
|
|
|
|
ivl_memory_t* mem_;
|
|
|
|
|
|
2001-04-06 04:28:02 +02:00
|
|
|
/* Scopes that are tasks/functions have a definition. */
|
2001-04-02 04:28:12 +02:00
|
|
|
ivl_statement_t def;
|
2001-04-06 04:28:02 +02:00
|
|
|
|
|
|
|
|
unsigned ports;
|
|
|
|
|
char **port;
|
2000-10-07 01:46:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* A signal is a think like a wire, a reg, or whatever. It has a type,
|
|
|
|
|
* and if it is a port is also has a directory. Signals are collected
|
|
|
|
|
* into scopes (which also point back to me) and have pins that
|
|
|
|
|
* connect to the rest of the netlist.
|
|
|
|
|
*/
|
|
|
|
|
struct ivl_signal_s {
|
|
|
|
|
ivl_signal_type_t type_;
|
|
|
|
|
ivl_signal_port_t port_;
|
|
|
|
|
|
|
|
|
|
unsigned width_ :24;
|
|
|
|
|
unsigned signed_ : 1;
|
|
|
|
|
|
2000-10-08 06:01:54 +02:00
|
|
|
char*name_;
|
2000-10-07 01:46:50 +02:00
|
|
|
ivl_scope_t scope_;
|
|
|
|
|
|
|
|
|
|
union {
|
|
|
|
|
ivl_nexus_t pin_;
|
|
|
|
|
ivl_nexus_t*pins_;
|
|
|
|
|
} n;
|
2000-12-05 07:29:33 +01:00
|
|
|
|
|
|
|
|
char**akey_;
|
|
|
|
|
char**aval_;
|
|
|
|
|
unsigned nattr_;
|
2000-09-30 04:18:15 +02:00
|
|
|
};
|
|
|
|
|
|
2000-09-18 03:24:32 +02:00
|
|
|
/*
|
|
|
|
|
* The ivl_statement_t represents any statement. The type of statement
|
|
|
|
|
* is defined by the ivl_statement_type_t enumeration. Given the type,
|
|
|
|
|
* certain information about the statement may be available.
|
|
|
|
|
*/
|
|
|
|
|
struct ivl_statement_s {
|
|
|
|
|
enum ivl_statement_type_e type_;
|
|
|
|
|
union {
|
2001-04-03 06:50:37 +02:00
|
|
|
struct { /* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB */
|
2000-10-18 22:04:39 +02:00
|
|
|
unsigned lvals_;
|
|
|
|
|
struct ivl_lval_s*lval_;
|
2000-10-07 01:46:50 +02:00
|
|
|
ivl_expr_t rval_;
|
2001-04-15 04:58:11 +02:00
|
|
|
ivl_expr_t delay;
|
2000-10-07 01:46:50 +02:00
|
|
|
} assign_;
|
|
|
|
|
|
2001-03-30 07:49:52 +02:00
|
|
|
struct { /* IVL_ST_BLOCK, IVL_ST_FORK */
|
2000-09-18 03:24:32 +02:00
|
|
|
struct ivl_statement_s*stmt_;
|
|
|
|
|
unsigned nstmt_;
|
|
|
|
|
} block_;
|
|
|
|
|
|
2001-03-31 19:36:38 +02:00
|
|
|
struct { /* IVL_ST_CASE, IVL_ST_CASEX, IVL_ST_CASEZ */
|
|
|
|
|
ivl_expr_t cond;
|
|
|
|
|
unsigned ncase;
|
|
|
|
|
ivl_expr_t*case_ex;
|
|
|
|
|
struct ivl_statement_s*case_st;
|
|
|
|
|
} case_;
|
|
|
|
|
|
2000-09-18 03:24:32 +02:00
|
|
|
struct { /* IVL_ST_CONDIT */
|
2000-09-30 04:18:15 +02:00
|
|
|
/* This is the condition expression */
|
|
|
|
|
ivl_expr_t cond_;
|
|
|
|
|
/* This is two statements, the true and false. */
|
2000-09-18 03:24:32 +02:00
|
|
|
struct ivl_statement_s*stmt_;
|
|
|
|
|
} condit_;
|
|
|
|
|
|
|
|
|
|
struct { /* IVL_ST_DELAY */
|
|
|
|
|
unsigned long delay_;
|
|
|
|
|
ivl_statement_t stmt_;
|
|
|
|
|
} delay_;
|
|
|
|
|
|
|
|
|
|
struct { /* IVL_ST_DELAYX */
|
|
|
|
|
int expr_; /* XXXX */
|
|
|
|
|
ivl_statement_t stmt_;
|
|
|
|
|
} delayx_;
|
|
|
|
|
|
2001-04-07 21:24:36 +02:00
|
|
|
struct { /* IVL_ST_DISABLE */
|
|
|
|
|
ivl_scope_t scope;
|
|
|
|
|
} disable_;
|
|
|
|
|
|
2001-04-04 06:50:35 +02:00
|
|
|
struct { /* IVL_ST_FOREVER */
|
|
|
|
|
ivl_statement_t stmt_;
|
|
|
|
|
} forever_;
|
|
|
|
|
|
2000-09-22 05:58:30 +02:00
|
|
|
struct { /* IVL_ST_STASK */
|
|
|
|
|
char* name_;
|
2000-09-23 07:15:07 +02:00
|
|
|
unsigned nparm_;
|
|
|
|
|
ivl_expr_t*parms_;
|
2000-09-22 05:58:30 +02:00
|
|
|
} stask_;
|
|
|
|
|
|
2000-09-26 02:30:07 +02:00
|
|
|
struct { /* IVL_ST_TRIGGER */
|
2001-03-28 08:07:39 +02:00
|
|
|
ivl_event_t event_;
|
2000-09-26 02:30:07 +02:00
|
|
|
} trig_;
|
|
|
|
|
|
2001-04-02 04:28:12 +02:00
|
|
|
struct { /* IVL_ST_UTASK */
|
|
|
|
|
ivl_scope_t def;
|
|
|
|
|
} utask_;
|
|
|
|
|
|
2000-09-18 03:24:32 +02:00
|
|
|
struct { /* IVL_ST_WAIT */
|
2001-03-28 08:07:39 +02:00
|
|
|
ivl_event_t event_;
|
2000-09-18 03:24:32 +02:00
|
|
|
ivl_statement_t stmt_;
|
|
|
|
|
} wait_;
|
|
|
|
|
|
2001-04-05 05:20:57 +02:00
|
|
|
struct { /* IVL_ST_WHILE IVL_ST_REPEAT */
|
2001-04-01 08:52:27 +02:00
|
|
|
ivl_expr_t cond_;
|
2000-09-18 03:24:32 +02:00
|
|
|
ivl_statement_t stmt_;
|
|
|
|
|
} while_;
|
|
|
|
|
} u_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* $Log: t-dll.h,v $
|
2001-05-09 01:59:33 +02:00
|
|
|
* Revision 1.43 2001/05/08 23:59:33 steve
|
|
|
|
|
* Add ivl and vvp.tgt support for memories in
|
|
|
|
|
* expressions and l-values. (Stephan Boettcher)
|
|
|
|
|
*
|
2001-05-06 19:48:20 +02:00
|
|
|
* Revision 1.42 2001/05/06 17:48:20 steve
|
|
|
|
|
* Support memory objects. (Stephan Boettcher)
|
|
|
|
|
*
|
2001-04-30 01:17:38 +02:00
|
|
|
* Revision 1.41 2001/04/29 23:17:38 steve
|
|
|
|
|
* Carry drive strengths in the ivl_nexus_ptr_t, and
|
|
|
|
|
* handle constant devices in targets.'
|
|
|
|
|
*
|
2001-04-26 07:12:02 +02:00
|
|
|
* Revision 1.40 2001/04/26 05:12:02 steve
|
|
|
|
|
* Implement simple MUXZ for ?: operators.
|
|
|
|
|
*
|
2001-04-23 01:09:45 +02:00
|
|
|
* Revision 1.39 2001/04/22 23:09:46 steve
|
|
|
|
|
* More UDP consolidation from Stephan Boettcher.
|
|
|
|
|
*
|
2001-04-15 04:58:11 +02:00
|
|
|
* Revision 1.38 2001/04/15 02:58:11 steve
|
|
|
|
|
* vvp support for <= with internal delay.
|
|
|
|
|
*
|
2001-04-07 21:24:36 +02:00
|
|
|
* Revision 1.37 2001/04/07 19:26:32 steve
|
|
|
|
|
* Add the disable statemnent.
|
|
|
|
|
*
|
2001-04-06 04:28:02 +02:00
|
|
|
* Revision 1.36 2001/04/06 02:28:02 steve
|
|
|
|
|
* Generate vvp code for functions with ports.
|
|
|
|
|
*
|
2001-04-05 05:20:57 +02:00
|
|
|
* Revision 1.35 2001/04/05 03:20:58 steve
|
|
|
|
|
* Generate vvp code for the repeat statement.
|
|
|
|
|
*
|
2001-04-04 06:50:35 +02:00
|
|
|
* Revision 1.34 2001/04/04 04:50:35 steve
|
|
|
|
|
* Support forever loops in the tgt-vvp target.
|
|
|
|
|
*
|
2001-04-03 06:50:37 +02:00
|
|
|
* Revision 1.33 2001/04/03 04:50:37 steve
|
|
|
|
|
* Support non-blocking assignments.
|
|
|
|
|
*
|
2001-04-02 04:28:12 +02:00
|
|
|
* Revision 1.32 2001/04/02 02:28:12 steve
|
|
|
|
|
* Generate code for task calls.
|
|
|
|
|
*
|
2001-04-02 02:28:35 +02:00
|
|
|
* Revision 1.31 2001/04/02 00:28:35 steve
|
|
|
|
|
* Support the scope expression node.
|
|
|
|
|
*
|
2001-04-01 08:52:27 +02:00
|
|
|
* Revision 1.30 2001/04/01 06:52:28 steve
|
|
|
|
|
* support the NetWhile statement.
|
|
|
|
|
*
|
2001-04-01 03:48:21 +02:00
|
|
|
* Revision 1.29 2001/04/01 01:48:21 steve
|
|
|
|
|
* Redesign event information to support arbitrary edge combining.
|
2000-09-18 03:24:32 +02:00
|
|
|
*/
|
|
|
|
|
#endif
|