summaryrefslogtreecommitdiffstats
path: root/src/def.h
blob: 83b48ee390b005ed430f06f46fc3dce2cb517c93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
    vhd2vl v2.3
    VHDL to Verilog RTL translator
    Copyright (C) 2001 Vincenzo Liguori - Ocean Logic Pty Ltd - http://www.ocean-logic.com
    Modifications (C) 2006 Mark Gonzales - PMC Sierra Inc

    This program is free software; you can redistribute it and/or modify
    it 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.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef __def_h
#define __def_h

#define MAXINDENT 36
#define MAXEDGES  1000  /* maximum number of @(edge) processes supported in a source file */

typedef struct nlist {
  char *name; /* Name */
  struct nlist *next;
} nlist;

enum slistType {tSLIST, tTXT, tVAL, tPTXT, tOTHERS};
typedef struct slist {
  enum slistType type;
  struct slist *slst;
  union {
    struct slist *sl; /* type 0 */
    char *txt;        /* type 1 */
    char **ptxt;      /* type 3!*/
    int val;          /* type 2,4 */
  } data;
} slist;

enum vrangeType {tSCALAR, tSUBSCRIPT, tVRANGE};
typedef struct vrange {
  /*  int hi, lo; */
  enum vrangeType vtype;
  struct slist *nhi, *nlo; /* MAG index is a simple expression */
  slist *size_expr;        /* expression that calculates size (width) of this vrange */
  int    sizeval;          /* precalculated size value */
  int    updown;           /* only used for indext part select case */
  struct slist *xhi, *xlo; /* array index range; 0,0 for normal scalars */
} vrange;

typedef struct slval {
  slist *sl;
  int val; /* Signal size */
  vrange *range; /* Signal size */
} slval;

typedef struct expdata {
  char op;
  int value;  /* only set for simple_expr */
  slist *sl;
} expdata;

typedef struct sglist {
  char *name; /* Signal name */
  char *type; /* Reg or wire */
  const char *dir; /* input, output, inout */
  vrange *range; /* Signal size */
  struct sglist *next;
} sglist;

typedef struct blknamelist {
  char *name; /* Optional name */
  struct blknamelist *next;
} blknamelist;

#endif
OpenPOWER on IntegriCloud