File: priv.h

package info (click to toggle)
iverilog 12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,148 kB
  • sloc: cpp: 109,972; ansic: 62,713; yacc: 10,216; sh: 3,470; vhdl: 3,246; perl: 1,814; makefile: 1,774; python: 78; csh: 2
file content (100 lines) | stat: -rw-r--r-- 3,069 bytes parent folder | download | duplicates (6)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef IVL_priv_H
#define IVL_priv_H
/*
 * Copyright (c) 2000-2014 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

# include  <ivl_target.h>
# include  <ipal.h>


extern pal_t pal;

extern unsigned error_count;

/*
 * A device has an array of pins, that are bound to the netlist either
 * by attribute or by random lookup. The bind_pin table keeps track of
 * pin allocations.
 *
 * Each cell also has attached to it an expression that calculates
 * results from an input. That expression is represented by a sum of
 * product terms. A product term is an array of term_t objects,
 * terminated by a term will a null nex pointers. A sum, then, is an
 * array of pointers to term_t arrays, terminated by a null pointer.
 */

typedef struct term_s {
      int inv;
      ivl_nexus_t nex;
} term_t;

/*
 * This structure describes a target device pin. If the pin is not
 * controlled by the pal (i.e. it is a power pin) then the sop field
 * is null. Otherwise, the sop in the macrocell that controls the pin.
 *
 * If the pin has an enable, then the sop for the enable function is
 * stored here as well.
 *
 * This structure for collecting the PAL design assumes that all the
 * macrocells are associated with pins, or are enables for other
 * pins.
 *
 * The bind_pin array is the complete description of the target as it
 * is accumulated.
 */
struct pal_bind_s {
	/* This is the netlist connection for the pin. */
      ivl_nexus_t nexus;
	/* If the pin is an output, this is is sop that drives it. */
      pal_sop_t sop;

	/* If the output has an enable, this is it, along with the
	   single term that activates it. */
      ivl_net_logic_t enable;
      term_t **enable_ex;

	/* If there is a register here, this is it. */
      ivl_lpm_t reg;
      unsigned reg_q;

	/* The input to the cell is this expression. */
      term_t **sop_ex;
	/* These are the SOP flags that I believe I need. */
      unsigned sop_inv  : 1;
};

extern unsigned pins;
extern struct pal_bind_s* bind_pin;


/*
 * These are various steps in the fitting process.
 */
extern int get_pad_bindings(ivl_scope_t net, void*x);

extern void absorb_pad_enables(void);

extern int fit_registers(ivl_scope_t scope, void*x);

extern int fit_logic(void);

extern int emit_jedec(const char*path);

#endif /* IVL_priv_H */