added typedefs on used structs, updated xschemtest with new hashes
This commit is contained in:
parent
2ec66255e3
commit
a0e057a52d
|
|
@ -659,8 +659,8 @@ void attach_labels_to_inst(int interactive) /* offloaded from callback.c 201710
|
|||
const char *rot_txt;
|
||||
int rotated_text=-1;
|
||||
|
||||
struct wireentry *wptr;
|
||||
struct instpinentry *iptr;
|
||||
Wireentry *wptr;
|
||||
Instpinentry *iptr;
|
||||
int sqx, sqy;
|
||||
int first_call;
|
||||
struct stat buf;
|
||||
|
|
@ -1371,7 +1371,7 @@ void calc_drawing_bbox(xRect *boundbox, int selected)
|
|||
for(i=0;i<xctx->instances;i++)
|
||||
{
|
||||
char *type;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
|
||||
if(selected == 1 && !xctx->inst[i].sel) continue;
|
||||
|
||||
|
|
|
|||
10
src/check.c
10
src/check.c
|
|
@ -46,12 +46,12 @@ static int check_breaks(double x1, double y1, double x2, double y2, double x, do
|
|||
void update_conn_cues(int draw_cues, int dr_win)
|
||||
{
|
||||
int k, i, l, sqx, sqy, save_draw;
|
||||
struct wireentry *wptr;
|
||||
Wireentry *wptr;
|
||||
double x0, y0;
|
||||
double x1, y1, x2, y2;
|
||||
struct wireentry *wireptr;
|
||||
Wireentry *wireptr;
|
||||
xWire * const wire = xctx->wire;
|
||||
struct iterator_ctx ctx;
|
||||
Iterator_ctx ctx;
|
||||
|
||||
hash_wires(); /* must be done also if wires==0 to clear wire_spatial_table */
|
||||
if(!xctx->wires) return;
|
||||
|
|
@ -140,7 +140,7 @@ void trim_wires(void)
|
|||
double x0, y0;
|
||||
int j, i, changed;
|
||||
int includes, breaks;
|
||||
struct wireentry *wptr;
|
||||
Wireentry *wptr;
|
||||
unsigned short *wireflag=NULL;
|
||||
|
||||
doloops = 0;
|
||||
|
|
@ -382,7 +382,7 @@ void break_wires_at_pins(void)
|
|||
{
|
||||
int k, i, j, r, rects, sqx, sqy;
|
||||
short rot, flip;
|
||||
struct wireentry *wptr;
|
||||
Wireentry *wptr;
|
||||
xRect *rct;
|
||||
double x0, y0, rx1, ry1;
|
||||
int changed=0;
|
||||
|
|
|
|||
10
src/draw.c
10
src/draw.c
|
|
@ -1657,7 +1657,7 @@ int read_rawfile(const char *f)
|
|||
|
||||
int get_raw_index(const char *node)
|
||||
{
|
||||
struct int_hashentry *entry;
|
||||
Int_hashentry *entry;
|
||||
if(xctx->values) {
|
||||
entry = int_hash_lookup(xctx->raw_table, node, 0, XLOOKUP);
|
||||
if(entry) return entry->value;
|
||||
|
|
@ -1840,7 +1840,7 @@ void draw_graph(int c, int i, int flags)
|
|||
const char *val;
|
||||
char *node = NULL, *color = NULL, *sweep = NULL;
|
||||
double txtsizelab, txtsizey, txtsizex, tmp;
|
||||
struct int_hashentry *entry;
|
||||
Int_hashentry *entry;
|
||||
int sweep_idx = 0;
|
||||
int n_nodes; /* number of variables to display in a single graph */
|
||||
xRect *r = &xctx->rect[c][i];
|
||||
|
|
@ -2155,8 +2155,8 @@ void draw(void)
|
|||
{
|
||||
/* inst_ptr and wire hash iterator 20171224 */
|
||||
double x1, y1, x2, y2;
|
||||
struct instentry *instanceptr;
|
||||
struct wireentry *wireptr;
|
||||
Instentry *instanceptr;
|
||||
Wireentry *wireptr;
|
||||
int use_hash;
|
||||
int c, i = 0;
|
||||
xSymbol *symptr;
|
||||
|
|
@ -2187,7 +2187,7 @@ void draw(void)
|
|||
hash_wires();
|
||||
}
|
||||
if(!xctx->only_probes) {
|
||||
struct iterator_ctx ctx;
|
||||
Iterator_ctx ctx;
|
||||
dbg(3, "draw(): check4\n");
|
||||
for(c=0;c<cadlayers;c++) {
|
||||
if(xctx->draw_single_layer!=-1 && c != xctx->draw_single_layer) continue;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "xschem.h"
|
||||
|
||||
void init_inst_iterator(struct iterator_ctx *ctx, double x1, double y1, double x2, double y2)
|
||||
void init_inst_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, double y2)
|
||||
{
|
||||
ctx->instflag = NULL;
|
||||
dbg(3, "init_inst_iterator(): instances=%d\n", xctx->instances);
|
||||
|
|
@ -47,9 +47,9 @@ void init_inst_iterator(struct iterator_ctx *ctx, double x1, double y1, double x
|
|||
}
|
||||
|
||||
|
||||
struct instentry *inst_iterator_next(struct iterator_ctx *ctx)
|
||||
Instentry *inst_iterator_next(Iterator_ctx *ctx)
|
||||
{
|
||||
struct instentry *ptr;
|
||||
Instentry *ptr;
|
||||
/* dbg(3, "inst_iterator_next(): instances=%d\n", xctx->instances); */
|
||||
while(1) {
|
||||
while(ctx->instanceptr) {
|
||||
|
|
@ -78,7 +78,7 @@ struct instentry *inst_iterator_next(struct iterator_ctx *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
void init_wire_iterator(struct iterator_ctx *ctx, double x1, double y1, double x2, double y2)
|
||||
void init_wire_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, double y2)
|
||||
{
|
||||
ctx->wireflag = NULL;
|
||||
dbg(3, "init_wire_iterator(): wires=%d\n", xctx->wires);
|
||||
|
|
@ -102,9 +102,9 @@ void init_wire_iterator(struct iterator_ctx *ctx, double x1, double y1, double x
|
|||
}
|
||||
|
||||
|
||||
struct wireentry *wire_iterator_next(struct iterator_ctx *ctx)
|
||||
Wireentry *wire_iterator_next(Iterator_ctx *ctx)
|
||||
{
|
||||
struct wireentry *ptr;
|
||||
Wireentry *ptr;
|
||||
/* dbg(3, "wire_iterator_next(): wires=%d\n", xctx->wires); */
|
||||
while(1) {
|
||||
while(ctx->wireptr) {
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ static unsigned int hi_hash(const char *tok)
|
|||
return hash;
|
||||
}
|
||||
|
||||
static void hilight_hash_free_entry(struct hilight_hashentry *entry)
|
||||
static void hilight_hash_free_entry(Hilight_hashentry *entry)
|
||||
{
|
||||
struct hilight_hashentry *tmp;
|
||||
Hilight_hashentry *tmp;
|
||||
while(entry) {
|
||||
tmp = entry->next;
|
||||
my_free(1287, &entry->token);
|
||||
|
|
@ -65,7 +65,7 @@ static void hilight_hash_free(void) /* remove the whole hash table */
|
|||
}
|
||||
}
|
||||
|
||||
static struct hilight_hashentry *hilight_hash_lookup(const char *token, int value, int what)
|
||||
static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int what)
|
||||
/* token what ... what ...
|
||||
* --------------------------------------------------------------------------
|
||||
* "whatever" XINSERT insert in hash table if not in and return NULL. If already present update
|
||||
|
|
@ -76,7 +76,7 @@ static struct hilight_hashentry *hilight_hash_lookup(const char *token, int valu
|
|||
*/
|
||||
{
|
||||
unsigned int hashcode, index;
|
||||
struct hilight_hashentry *entry, *saveptr, **preventry;
|
||||
Hilight_hashentry *entry, *saveptr, **preventry;
|
||||
char *ptr;
|
||||
int s ;
|
||||
|
||||
|
|
@ -90,9 +90,9 @@ static struct hilight_hashentry *hilight_hash_lookup(const char *token, int valu
|
|||
int lent = strlen(token) + 1;
|
||||
int lenp = strlen(xctx->sch_path[xctx->currsch]) + 1;
|
||||
if( what==XINSERT || what == XINSERT_NOREPLACE) { /* insert data */
|
||||
s=sizeof( struct hilight_hashentry );
|
||||
s=sizeof( Hilight_hashentry );
|
||||
ptr= my_malloc(137, s );
|
||||
entry=(struct hilight_hashentry *)ptr;
|
||||
entry=(Hilight_hashentry *)ptr;
|
||||
entry->next = NULL;
|
||||
entry->token = my_malloc(778, lent);
|
||||
memcpy(entry->token, token, lent);
|
||||
|
|
@ -128,11 +128,11 @@ static struct hilight_hashentry *hilight_hash_lookup(const char *token, int valu
|
|||
}
|
||||
|
||||
/* warning, in case of buses return only pointer to first found bus element */
|
||||
struct hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int what)
|
||||
Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int what)
|
||||
{
|
||||
char *start, *string_ptr, c;
|
||||
char *string=NULL;
|
||||
struct hilight_hashentry *ptr1=NULL, *ptr2=NULL;
|
||||
Hilight_hashentry *ptr1=NULL, *ptr2=NULL;
|
||||
int mult;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
|
|
@ -172,7 +172,7 @@ void display_hilights(char **str)
|
|||
{
|
||||
int i;
|
||||
int first = 1;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
for(i=0;i<HASHSIZE;i++) {
|
||||
entry = xctx->hilight_table[i];
|
||||
while(entry) {
|
||||
|
|
@ -191,7 +191,7 @@ static int there_are_hilights()
|
|||
{
|
||||
register int i;
|
||||
register xInstance * inst = xctx->inst;
|
||||
register struct hilight_hashentry **hiptr = xctx->hilight_table;
|
||||
register Hilight_hashentry **hiptr = xctx->hilight_table;
|
||||
for(i=0;i<HASHSIZE;i++) {
|
||||
if(hiptr[i]) return 1;
|
||||
}
|
||||
|
|
@ -232,8 +232,8 @@ void incr_hilight_color(void)
|
|||
void create_plot_cmd(void)
|
||||
{
|
||||
int i, c, idx, first;
|
||||
struct hilight_hashentry *entry;
|
||||
struct node_hashentry *node_entry;
|
||||
Hilight_hashentry *entry;
|
||||
Node_hashentry *node_entry;
|
||||
char *tok;
|
||||
char plotfile[PATH_MAX];
|
||||
char color_str[30];
|
||||
|
|
@ -448,7 +448,7 @@ void hilight_net_pin_mismatches(void)
|
|||
void hilight_parent_pins(void)
|
||||
{
|
||||
int rects, i, j, k;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
const char *pin_name;
|
||||
char *pin_node = NULL;
|
||||
char *net_node=NULL;
|
||||
|
|
@ -499,7 +499,7 @@ void hilight_child_pins(void)
|
|||
const char *pin_name;
|
||||
char *pin_node = NULL;
|
||||
char *net_node=NULL;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
int mult, net_mult, i, inst_number;
|
||||
|
||||
i = xctx->previous_instance[xctx->currsch-1];
|
||||
|
|
@ -767,7 +767,7 @@ void drill_hilight(int mode)
|
|||
int i, j, npin;
|
||||
char *propagate_str = NULL;
|
||||
int propagate, hilight_connected_inst;
|
||||
struct hilight_hashentry *entry, *propag_entry;
|
||||
Hilight_hashentry *entry, *propag_entry;
|
||||
int en_hi;
|
||||
|
||||
en_hi = tclgetboolvar("en_hilight_conn_inst");
|
||||
|
|
@ -821,7 +821,7 @@ void drill_hilight(int mode)
|
|||
|
||||
int hilight_netname(const char *name)
|
||||
{
|
||||
struct node_hashentry *node_entry;
|
||||
Node_hashentry *node_entry;
|
||||
prepare_netlist_structs(0);
|
||||
dbg(1, "hilight_netname(): entering\n");
|
||||
rebuild_selected_array();
|
||||
|
|
@ -838,7 +838,7 @@ int hilight_netname(const char *name)
|
|||
static void send_net_to_bespice(int simtype, const char *node)
|
||||
{
|
||||
int c, k, tok_mult;
|
||||
struct node_hashentry *node_entry;
|
||||
Node_hashentry *node_entry;
|
||||
const char *expanded_tok;
|
||||
const char *tok;
|
||||
char color_str[30];
|
||||
|
|
@ -902,7 +902,7 @@ static void send_net_to_bespice(int simtype, const char *node)
|
|||
static void send_net_to_gaw(int simtype, const char *node)
|
||||
{
|
||||
int c, k, tok_mult;
|
||||
struct node_hashentry *node_entry;
|
||||
Node_hashentry *node_entry;
|
||||
const char *expanded_tok;
|
||||
const char *tok;
|
||||
char color_str[8];
|
||||
|
|
@ -1051,7 +1051,7 @@ static void send_current_to_gaw(int simtype, const char *node)
|
|||
void propagate_hilights(int set, int clear, int mode)
|
||||
{
|
||||
int i, hilight_connected_inst;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
char *type;
|
||||
int en_hi;
|
||||
|
||||
|
|
@ -1112,7 +1112,7 @@ void propagate_hilights(int set, int clear, int mode)
|
|||
int get_logic_value(int inst, int n)
|
||||
{
|
||||
int /* mult, */ val;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
/* char *netname = NULL; */
|
||||
|
||||
/* fast option: dont use net_name() (no expandlabel though) */
|
||||
|
|
@ -1317,13 +1317,13 @@ void create_simdata(void)
|
|||
int i, j;
|
||||
const char *str;
|
||||
free_simdata();
|
||||
my_realloc(60, &xctx->simdata, xctx->instances * sizeof(struct simdata));
|
||||
my_realloc(60, &xctx->simdata, xctx->instances * sizeof(Simdata));
|
||||
xctx->simdata_ninst = xctx->instances;
|
||||
for(i = 0; i < xctx->instances; i++) {
|
||||
xSymbol *symbol = xctx->inst[i].ptr + xctx->sym;
|
||||
int npin = symbol->rects[PINLAYER];
|
||||
xctx->simdata[i].pin = NULL;
|
||||
if(npin) my_realloc(61, &xctx->simdata[i].pin, npin * sizeof(struct simdata_pin));
|
||||
if(npin) my_realloc(61, &xctx->simdata[i].pin, npin * sizeof(Simdata_pin));
|
||||
xctx->simdata[i].npin = npin;
|
||||
for(j = 0; j < npin; j++) {
|
||||
char function[20];
|
||||
|
|
@ -1363,7 +1363,7 @@ void propagate_logic()
|
|||
int found, iter = 0 /* , mult */;
|
||||
int i, j, npin;
|
||||
int propagate;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
int val, newval;
|
||||
static const int map[] = {LOGIC_0, LOGIC_1, LOGIC_X, LOGIC_Z, LOGIC_NOUP};
|
||||
|
||||
|
|
@ -1483,7 +1483,7 @@ void logic_set(int value, int num)
|
|||
xRect boundbox;
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
static const int map[] = {LOGIC_0, LOGIC_1, LOGIC_X, LOGIC_Z, LOGIC_NOUP};
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
|
||||
tclsetvar("tclstop", "0");
|
||||
prepare_netlist_structs(0);
|
||||
|
|
@ -1652,7 +1652,7 @@ void select_hilight_net(void)
|
|||
{
|
||||
char *type=NULL;
|
||||
int i;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
int hilight_connected_inst;
|
||||
int en_hi;
|
||||
|
||||
|
|
@ -1704,10 +1704,10 @@ void draw_hilight_net(int on_window)
|
|||
double x1,y1,x2,y2;
|
||||
xSymbol *symptr;
|
||||
int use_hash;
|
||||
struct wireentry *wireptr;
|
||||
struct instentry *instanceptr;
|
||||
struct hilight_hashentry *entry;
|
||||
struct iterator_ctx ctx;
|
||||
Wireentry *wireptr;
|
||||
Instentry *instanceptr;
|
||||
Hilight_hashentry *entry;
|
||||
Iterator_ctx ctx;
|
||||
|
||||
if(!xctx->hilight_nets) return;
|
||||
dbg(3, "draw_hilight_net(): xctx->prep_hi_structs=%d\n", xctx->prep_hi_structs);
|
||||
|
|
@ -1792,8 +1792,8 @@ void print_hilight_net(int show)
|
|||
{
|
||||
int i;
|
||||
FILE *fd;
|
||||
struct hilight_hashentry *entry;
|
||||
struct node_hashentry *node_entry;
|
||||
Hilight_hashentry *entry;
|
||||
Node_hashentry *node_entry;
|
||||
char cmd[2*PATH_MAX]; /* 20161122 overflow safe */
|
||||
char cmd2[2*PATH_MAX]; /* 20161122 overflow safe */
|
||||
char cmd3[2*PATH_MAX]; /* 20161122 overflow safe */
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ void draw_selection(GC g, int interruptable)
|
|||
*/
|
||||
void find_inst_to_be_redrawn(int what)
|
||||
{
|
||||
struct int_hashentry *nentry;
|
||||
Int_hashentry *nentry;
|
||||
int i, n, p, rects;
|
||||
xSymbol * sym;
|
||||
xInstance * const inst = xctx->inst;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
static void instdelete(int n, int x, int y)
|
||||
{
|
||||
struct instentry *saveptr, **prevptr;
|
||||
Instentry *saveptr, **prevptr;
|
||||
|
||||
prevptr = &xctx->inst_spatial_table[x][y];
|
||||
while( (*prevptr)->n != n) prevptr = &(*prevptr)->next;
|
||||
|
|
@ -35,18 +35,18 @@ static void instdelete(int n, int x, int y)
|
|||
|
||||
static void instinsert(int n, int x, int y)
|
||||
{
|
||||
struct instentry *ptr, *newptr;
|
||||
Instentry *ptr, *newptr;
|
||||
ptr=xctx->inst_spatial_table[x][y];
|
||||
newptr=my_malloc(236, sizeof(struct instentry));
|
||||
newptr=my_malloc(236, sizeof(Instentry));
|
||||
newptr->next=ptr;
|
||||
newptr->n=n;
|
||||
xctx->inst_spatial_table[x][y]=newptr;
|
||||
dbg(2, "instinsert(): inserting object %d at %d,%d\n",n,x,y);
|
||||
}
|
||||
|
||||
static struct instentry *delinstentry(struct instentry *t)
|
||||
static Instentry *delinstentry(Instentry *t)
|
||||
{
|
||||
struct instentry *tmp;
|
||||
Instentry *tmp;
|
||||
while( t ) {
|
||||
tmp = t->next;
|
||||
my_free(822, &t);
|
||||
|
|
@ -124,7 +124,7 @@ void hash_instances(void) /* 20171203 insert object bbox in spatial hash table *
|
|||
|
||||
static void instpindelete(int n,int pin, int x, int y)
|
||||
{
|
||||
struct instpinentry *saveptr, **prevptr, *ptr;
|
||||
Instpinentry *saveptr, **prevptr, *ptr;
|
||||
|
||||
prevptr = &xctx->instpin_spatial_table[x][y];
|
||||
ptr = *prevptr;
|
||||
|
|
@ -143,10 +143,10 @@ static void instpindelete(int n,int pin, int x, int y)
|
|||
/* --pin coordinates-- -square coord- */
|
||||
static void instpininsert(int n,int pin, double x0, double y0, int x, int y)
|
||||
{
|
||||
struct instpinentry *ptr, *newptr;
|
||||
Instpinentry *ptr, *newptr;
|
||||
|
||||
ptr=xctx->instpin_spatial_table[x][y];
|
||||
newptr=my_malloc(237, sizeof(struct instpinentry));
|
||||
newptr=my_malloc(237, sizeof(Instpinentry));
|
||||
newptr->next=ptr;
|
||||
newptr->n=n;
|
||||
newptr->x0=x0;
|
||||
|
|
@ -157,9 +157,9 @@ static void instpininsert(int n,int pin, double x0, double y0, int x, int y)
|
|||
}
|
||||
|
||||
|
||||
struct instpinentry *delinstpinentry(struct instpinentry *t)
|
||||
Instpinentry *delinstpinentry(Instpinentry *t)
|
||||
{
|
||||
struct instpinentry *tmp;
|
||||
Instpinentry *tmp;
|
||||
|
||||
while(t) {
|
||||
tmp = t->next;
|
||||
|
|
@ -181,7 +181,7 @@ static void del_inst_pin_table(void)
|
|||
|
||||
static void wiredelete(int n, int x, int y)
|
||||
{
|
||||
struct wireentry *saveptr, **prevptr;
|
||||
Wireentry *saveptr, **prevptr;
|
||||
|
||||
prevptr = &xctx->wire_spatial_table[x][y];
|
||||
while( (*prevptr)->n != n) prevptr = &(*prevptr)->next;
|
||||
|
|
@ -192,19 +192,19 @@ static void wiredelete(int n, int x, int y)
|
|||
|
||||
static void wireinsert(int n, int x, int y)
|
||||
{
|
||||
struct wireentry *ptr, *newptr;
|
||||
Wireentry *ptr, *newptr;
|
||||
|
||||
ptr=xctx->wire_spatial_table[x][y];
|
||||
newptr=my_malloc(238, sizeof(struct wireentry));
|
||||
newptr=my_malloc(238, sizeof(Wireentry));
|
||||
newptr->next=ptr;
|
||||
newptr->n=n;
|
||||
xctx->wire_spatial_table[x][y]=newptr;
|
||||
dbg(2, "wireinsert(): inserting wire %d at %d,%d\n",n,x,y);
|
||||
}
|
||||
|
||||
static struct wireentry *delwireentry(struct wireentry *t)
|
||||
static Wireentry *delwireentry(Wireentry *t)
|
||||
{
|
||||
struct wireentry *tmp;
|
||||
Wireentry *tmp;
|
||||
|
||||
while( t ) {
|
||||
tmp = t->next;
|
||||
|
|
@ -301,7 +301,7 @@ void hash_wire(int what, int n, int incremental)
|
|||
double tmpd;
|
||||
double x1, y1, x2, y2;
|
||||
int x1a, x2a, y1a, y2a;
|
||||
struct wireentry *wptr;
|
||||
Wireentry *wptr;
|
||||
xWire * const wire = xctx->wire;
|
||||
|
||||
wire[n].end1 = wire[n].end2=-1;
|
||||
|
|
@ -415,7 +415,7 @@ void netlist_options(int i)
|
|||
void print_wires(void)
|
||||
{
|
||||
int i,j;
|
||||
struct wireentry *ptr;
|
||||
Wireentry *ptr;
|
||||
for(i=0;i<NBOXES;i++) {
|
||||
for(j=0;j<NBOXES;j++)
|
||||
{
|
||||
|
|
@ -463,7 +463,7 @@ void wirecheck(int k) /* recursive routine */
|
|||
int touches;
|
||||
double x1, y1, x2, y2;
|
||||
int x1a, x2a, y1a, y2a;
|
||||
struct wireentry *ptr2;
|
||||
Wireentry *ptr2;
|
||||
xWire * const wire = xctx->wire;
|
||||
|
||||
x1=wire[k].x1;
|
||||
|
|
@ -626,8 +626,8 @@ void prepare_netlist_structs(int for_netlist)
|
|||
int touches=0;
|
||||
int touches_unnamed=0;
|
||||
double rx1,ry1;
|
||||
struct wireentry *wptr;
|
||||
struct instpinentry *iptr;
|
||||
Wireentry *wptr;
|
||||
Instpinentry *iptr;
|
||||
int i,j, rects, generic_rects;
|
||||
char *dir=NULL;
|
||||
char *type=NULL;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include "xschem.h"
|
||||
static struct node_hashentry *node_hash_lookup(const char *token, const char *dir,int what,int port,
|
||||
static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int what,int port,
|
||||
char *sig_type, char *verilog_type, char *value, char *class, const char *orig_tok)
|
||||
/* token dir et all what ... action ...
|
||||
* --------------------------------------------------------------------------
|
||||
|
|
@ -35,10 +35,10 @@ static struct node_hashentry *node_hash_lookup(const char *token, const char *di
|
|||
* "whatever" whatever 1,XLOOKUP only look up element, dont insert */
|
||||
{
|
||||
unsigned int hashcode, index;
|
||||
struct node_hashentry *entry, *saveptr, **preventry;
|
||||
Node_hashentry *entry, *saveptr, **preventry;
|
||||
char *ptr;
|
||||
int s ;
|
||||
struct drivers d;
|
||||
Drivers d;
|
||||
|
||||
if(token==NULL || token[0]==0 ) return NULL;
|
||||
dbg(3, "node_hash_lookup(): called with: %s dir=%s what=%d port=%d\n",
|
||||
|
|
@ -58,9 +58,9 @@ static struct node_hashentry *node_hash_lookup(const char *token, const char *di
|
|||
{
|
||||
if( what==XINSERT || what==XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( struct node_hashentry );
|
||||
s=sizeof( Node_hashentry );
|
||||
ptr= my_malloc(281, s );
|
||||
entry=(struct node_hashentry *)ptr;
|
||||
entry=(Node_hashentry *)ptr;
|
||||
entry->next = NULL;
|
||||
entry->token = entry->sig_type = entry->verilog_type =
|
||||
entry->value = entry->class = entry->orig_tok = NULL;
|
||||
|
|
@ -122,13 +122,13 @@ static struct node_hashentry *node_hash_lookup(const char *token, const char *di
|
|||
|
||||
/* wrapper to node_hash_lookup that handles buses */
|
||||
/* warning, in case of buses return only pointer to first bus element */
|
||||
struct node_hashentry *bus_node_hash_lookup(const char *token, const char *dir, int what, int port,
|
||||
Node_hashentry *bus_node_hash_lookup(const char *token, const char *dir, int what, int port,
|
||||
char *sig_type,char *verilog_type, char *value, char *class)
|
||||
{
|
||||
char *start, *string_ptr, c;
|
||||
int mult;
|
||||
char *string=NULL;
|
||||
struct node_hashentry *ptr1=NULL, *ptr2=NULL;
|
||||
Node_hashentry *ptr1=NULL, *ptr2=NULL;
|
||||
|
||||
if(token==NULL || token[0] == 0) return NULL;
|
||||
if( token[0] == '#')
|
||||
|
|
@ -164,9 +164,9 @@ struct node_hashentry *bus_node_hash_lookup(const char *token, const char *dir,
|
|||
return ptr2;
|
||||
}
|
||||
|
||||
static void node_hash_free_entry(struct node_hashentry *entry)
|
||||
static void node_hash_free_entry(Node_hashentry *entry)
|
||||
{
|
||||
struct node_hashentry *tmp;
|
||||
Node_hashentry *tmp;
|
||||
|
||||
while(entry) {
|
||||
tmp = entry->next;
|
||||
|
|
@ -196,7 +196,7 @@ void node_hash_free(void) /* remove the whole hash table */
|
|||
void traverse_node_hash()
|
||||
{
|
||||
int i;
|
||||
struct node_hashentry *entry;
|
||||
Node_hashentry *entry;
|
||||
char str[2048]; /* 20161122 overflow safe */
|
||||
int incr_hi;
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ void traverse_node_hash()
|
|||
|
||||
void print_vhdl_signals(FILE *fd)
|
||||
{
|
||||
struct node_hashentry *ptr;
|
||||
Node_hashentry *ptr;
|
||||
int i, found;
|
||||
int mult,j;
|
||||
char *class=NULL;
|
||||
|
|
@ -318,7 +318,7 @@ void print_vhdl_signals(FILE *fd)
|
|||
|
||||
void print_verilog_signals(FILE *fd)
|
||||
{
|
||||
struct node_hashentry *ptr;
|
||||
Node_hashentry *ptr;
|
||||
int i, found;
|
||||
int mult,j;
|
||||
|
||||
|
|
|
|||
|
|
@ -844,9 +844,9 @@ void create_ps(char **psfile, int what)
|
|||
|
||||
{
|
||||
double x1, y1, x2, y2;
|
||||
struct wireentry *wireptr;
|
||||
Wireentry *wireptr;
|
||||
int i;
|
||||
struct iterator_ctx ctx;
|
||||
Iterator_ctx ctx;
|
||||
update_conn_cues(0, 0);
|
||||
/* draw connecting dots */
|
||||
x1 = X_TO_XSCHEM(xctx->areax1);
|
||||
|
|
|
|||
14
src/save.c
14
src/save.c
|
|
@ -1376,7 +1376,7 @@ void pop_undo(int redo, int set_modify_status)
|
|||
* if pintable given (!=NULL) hash all symbol pins
|
||||
* if embed_fd is not NULL read symbol from embedded '[...]' tags using embed_fd file pointer */
|
||||
static void get_sym_type(const char *symname, char **type,
|
||||
struct int_hashentry **pintable, FILE *embed_fd, int *sym_n_pins)
|
||||
Int_hashentry **pintable, FILE *embed_fd, int *sym_n_pins)
|
||||
{
|
||||
int i, c, n = 0;
|
||||
char name[PATH_MAX];
|
||||
|
|
@ -1478,11 +1478,11 @@ static void align_sch_pins_with_sym(const char *name, int pos)
|
|||
char *symtype = NULL;
|
||||
const char *pinname;
|
||||
int i, fail = 0, sym_n_pins=0;
|
||||
struct int_hashentry *pintable[HASHSIZE];
|
||||
Int_hashentry *pintable[HASHSIZE];
|
||||
|
||||
if ((ptr = strrchr(name, '.')) && !strcmp(ptr, ".sch")) {
|
||||
my_strncpy(symname, add_ext(name, ".sym"), S(symname));
|
||||
memset(pintable, 0, HASHSIZE * sizeof(struct int_hashentry *));
|
||||
memset(pintable, 0, HASHSIZE * sizeof(Int_hashentry *));
|
||||
/* hash all symbol pins with their position into pintable hash*/
|
||||
get_sym_type(symname, &symtype, pintable, NULL, &sym_n_pins);
|
||||
if(symtype[0]) { /* found a .sym for current .sch LCC instance */
|
||||
|
|
@ -1495,7 +1495,7 @@ static void align_sch_pins_with_sym(const char *name, int pos)
|
|||
rect = (xRect *) my_malloc(1168, sizeof(xRect) * sym_n_pins);
|
||||
dbg(1, "align_sch_pins_with_sym(): symbol: %s\n", symname);
|
||||
for(i=0; i < xctx->sym[pos].rects[PINLAYER]; i++) {
|
||||
struct int_hashentry *entry;
|
||||
Int_hashentry *entry;
|
||||
pinname = get_tok_value(xctx->sym[pos].rect[PINLAYER][i].prop_ptr, "name", 0);
|
||||
entry = int_hash_lookup(pintable, pinname, 0 , XLOOKUP);
|
||||
if(!entry) {
|
||||
|
|
@ -1657,7 +1657,7 @@ void calc_symbol_bbox(int pos)
|
|||
int load_sym_def(const char *name, FILE *embed_fd)
|
||||
{
|
||||
static int recursion_counter=0; /* safe to keep even with multiple schematics, operation not interruptable */
|
||||
struct Lcc *lcc; /* size = level */
|
||||
Lcc *lcc; /* size = level */
|
||||
FILE *fd_tmp;
|
||||
short rot,flip;
|
||||
double angle;
|
||||
|
|
@ -1698,7 +1698,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
recursion_counter++;
|
||||
dbg(1, "l_s_d(): name=%s\n", name);
|
||||
lcc=NULL;
|
||||
my_realloc(647, &lcc, (level + 1) * sizeof(struct Lcc));
|
||||
my_realloc(647, &lcc, (level + 1) * sizeof(Lcc));
|
||||
max_level = level + 1;
|
||||
if(!strcmp(xctx->file_version,"1.0")) {
|
||||
my_strncpy(sympath, abs_sym_path(name, ".sym"), S(sympath));
|
||||
|
|
@ -2117,7 +2117,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
}
|
||||
if(fd_tmp) {
|
||||
if (level+1 >= max_level) {
|
||||
my_realloc(653, &lcc, (max_level + 1) * sizeof(struct Lcc));
|
||||
my_realloc(653, &lcc, (max_level + 1) * sizeof(Lcc));
|
||||
max_level++;
|
||||
}
|
||||
++level;
|
||||
|
|
|
|||
|
|
@ -2004,7 +2004,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
} else if(argc > 3) {
|
||||
/* xschem rawfile_query index v(ldxp) */
|
||||
if(!strcmp(argv[2], "index")) {
|
||||
struct int_hashentry *entry;
|
||||
Int_hashentry *entry;
|
||||
int idx;
|
||||
entry = int_hash_lookup(xctx->raw_table, argv[3], 0, XLOOKUP);
|
||||
idx = entry ? entry->value : -1;
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ static void check_connected_wire(int stop_at_junction, int n)
|
|||
{
|
||||
int k, touches;
|
||||
xWire * const wire = xctx->wire;
|
||||
struct wireentry *wireptr;
|
||||
struct instentry *instptr;
|
||||
Wireentry *wireptr;
|
||||
Instentry *instptr;
|
||||
char *type;
|
||||
double x1, y1, x2, y2;
|
||||
struct iterator_ctx ctx;
|
||||
Iterator_ctx ctx;
|
||||
|
||||
x1 = wire[n].x1;
|
||||
y1 = wire[n].y1;
|
||||
|
|
@ -109,7 +109,7 @@ void select_connected_wires(int stop_at_junction)
|
|||
double rx1, ry1, x0, y0;
|
||||
int rot, flip, sqx, sqy;
|
||||
xRect *rct;
|
||||
struct wireentry *wptr;
|
||||
Wireentry *wptr;
|
||||
rct = (xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER];
|
||||
if(rct) {
|
||||
x0 = (rct[0].x1 + rct[0].x2) / 2;
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
#include "xschem.h"
|
||||
|
||||
static struct str_hashentry *model_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
static struct str_hashentry *model_entry; /* safe even with multiple schematics */
|
||||
static struct str_hashentry *subckt_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
static Str_hashentry *model_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
static Str_hashentry *model_entry; /* safe even with multiple schematics */
|
||||
static Str_hashentry *subckt_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
|
||||
void hier_psprint(void) /* netlister driver */
|
||||
{
|
||||
|
|
@ -568,10 +568,10 @@ void spice_netlist(FILE *fd, int spice_stop )
|
|||
* return NULL if not found
|
||||
* "whatever" "whatever" XDELETE delete entry if found,return NULL
|
||||
*/
|
||||
struct str_hashentry *str_hash_lookup(struct str_hashentry **table, const char *token, const char *value, int what)
|
||||
Str_hashentry *str_hash_lookup(Str_hashentry **table, const char *token, const char *value, int what)
|
||||
{
|
||||
unsigned int hashcode, idx;
|
||||
struct str_hashentry *entry, *saveptr, **preventry;
|
||||
Str_hashentry *entry, *saveptr, **preventry;
|
||||
int s ;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
|
|
@ -585,8 +585,8 @@ struct str_hashentry *str_hash_lookup(struct str_hashentry **table, const char *
|
|||
{
|
||||
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( struct str_hashentry );
|
||||
entry=(struct str_hashentry *)my_malloc(313, s);
|
||||
s=sizeof( Str_hashentry );
|
||||
entry=(Str_hashentry *)my_malloc(313, s);
|
||||
entry->next=NULL;
|
||||
entry->token=NULL;
|
||||
entry->value=NULL;
|
||||
|
|
@ -617,9 +617,9 @@ struct str_hashentry *str_hash_lookup(struct str_hashentry **table, const char *
|
|||
}
|
||||
}
|
||||
|
||||
static void str_hash_free_entry(struct str_hashentry *entry)
|
||||
static void str_hash_free_entry(Str_hashentry *entry)
|
||||
{
|
||||
struct str_hashentry *tmp;
|
||||
Str_hashentry *tmp;
|
||||
while( entry ) {
|
||||
tmp = entry -> next;
|
||||
my_free(956, &(entry->token));
|
||||
|
|
@ -630,7 +630,7 @@ static void str_hash_free_entry(struct str_hashentry *entry)
|
|||
}
|
||||
|
||||
|
||||
void str_hash_free(struct str_hashentry **table)
|
||||
void str_hash_free(Str_hashentry **table)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -655,10 +655,10 @@ void str_hash_free(struct str_hashentry **table)
|
|||
* return NULL if not found
|
||||
* "whatever" "whatever" XDELETE delete entry if found,return NULL
|
||||
*/
|
||||
struct int_hashentry *int_hash_lookup(struct int_hashentry **table, const char *token, const int value, int what)
|
||||
Int_hashentry *int_hash_lookup(Int_hashentry **table, const char *token, const int value, int what)
|
||||
{
|
||||
unsigned int hashcode, idx;
|
||||
struct int_hashentry *entry, *saveptr, **preventry;
|
||||
Int_hashentry *entry, *saveptr, **preventry;
|
||||
int s ;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
|
|
@ -672,8 +672,8 @@ struct int_hashentry *int_hash_lookup(struct int_hashentry **table, const char *
|
|||
{
|
||||
if(what==XINSERT || what == XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( struct int_hashentry );
|
||||
entry=(struct int_hashentry *)my_malloc(659, s);
|
||||
s=sizeof( Int_hashentry );
|
||||
entry=(Int_hashentry *)my_malloc(659, s);
|
||||
entry->next=NULL;
|
||||
entry->token=NULL;
|
||||
my_strdup(658, &entry->token, token);
|
||||
|
|
@ -702,9 +702,9 @@ struct int_hashentry *int_hash_lookup(struct int_hashentry **table, const char *
|
|||
}
|
||||
}
|
||||
|
||||
static void int_hash_free_entry(struct int_hashentry *entry)
|
||||
static void int_hash_free_entry(Int_hashentry *entry)
|
||||
{
|
||||
struct int_hashentry *tmp;
|
||||
Int_hashentry *tmp;
|
||||
while( entry ) {
|
||||
tmp = entry -> next;
|
||||
my_free(1171, &(entry->token));
|
||||
|
|
@ -714,7 +714,7 @@ static void int_hash_free_entry(struct int_hashentry *entry)
|
|||
}
|
||||
|
||||
|
||||
void int_hash_free(struct int_hashentry **table)
|
||||
void int_hash_free(Int_hashentry **table)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ void svg_draw(void)
|
|||
const char *r, *textfont;
|
||||
int *unused_layer;
|
||||
int color;
|
||||
struct hilight_hashentry *entry;
|
||||
Hilight_hashentry *entry;
|
||||
|
||||
if(!lastdir[0]) my_strncpy(lastdir, pwd_dir, S(lastdir));
|
||||
if(has_x && !xctx->plotfile[0]) {
|
||||
|
|
@ -743,9 +743,9 @@ void svg_draw(void)
|
|||
}
|
||||
{
|
||||
double x1, y1, x2, y2;
|
||||
struct wireentry *wireptr;
|
||||
Wireentry *wireptr;
|
||||
int i;
|
||||
struct iterator_ctx ctx;
|
||||
Iterator_ctx ctx;
|
||||
update_conn_cues(0, 0);
|
||||
/* draw connecting dots */
|
||||
x1 = X_TO_XSCHEM(xctx->areax1);
|
||||
|
|
|
|||
26
src/token.c
26
src/token.c
|
|
@ -65,11 +65,11 @@ int name_strcmp(char *s, char *d) /* compare strings up to '\0' or'[' */
|
|||
* 1,XDELETE : delete token entry, return NULL
|
||||
* 2,XLOOKUP : lookup only
|
||||
*/
|
||||
static struct inst_hashentry *inst_hash_lookup(char *token, int value, int what, size_t token_size)
|
||||
static Inst_hashentry *inst_hash_lookup(char *token, int value, int what, size_t token_size)
|
||||
{
|
||||
unsigned int hashcode;
|
||||
unsigned int idx;
|
||||
struct inst_hashentry *entry, *saveptr, **preventry;
|
||||
Inst_hashentry *entry, *saveptr, **preventry;
|
||||
int s;
|
||||
|
||||
if(token==NULL) return NULL;
|
||||
|
|
@ -80,8 +80,8 @@ static struct inst_hashentry *inst_hash_lookup(char *token, int value, int what,
|
|||
while(1) {
|
||||
if( !entry ) { /* empty slot */
|
||||
if(what == XINSERT || what == XINSERT_NOREPLACE) { /* insert data */
|
||||
s=sizeof( struct inst_hashentry );
|
||||
entry=(struct inst_hashentry *) my_malloc(425, s);
|
||||
s=sizeof( Inst_hashentry );
|
||||
entry=(Inst_hashentry *) my_malloc(425, s);
|
||||
*preventry=entry;
|
||||
entry->next=NULL;
|
||||
entry->hash=hashcode;
|
||||
|
|
@ -107,9 +107,9 @@ static struct inst_hashentry *inst_hash_lookup(char *token, int value, int what,
|
|||
}
|
||||
}
|
||||
|
||||
static void inst_hash_free_entry(struct inst_hashentry *entry)
|
||||
static void inst_hash_free_entry(Inst_hashentry *entry)
|
||||
{
|
||||
struct inst_hashentry *tmp;
|
||||
Inst_hashentry *tmp;
|
||||
while( entry ) {
|
||||
tmp = entry -> next;
|
||||
my_free(971, &entry);
|
||||
|
|
@ -170,7 +170,7 @@ void check_unique_names(int rename)
|
|||
int i, first = 1;
|
||||
int newpropcnt = 0;
|
||||
char *tmp = NULL;
|
||||
struct inst_hashentry *entry;
|
||||
Inst_hashentry *entry;
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000;
|
||||
/* int save_draw; */
|
||||
|
||||
|
|
@ -647,7 +647,7 @@ void new_prop_string(int i, const char *old_prop, int fast, int dis_uniq_names)
|
|||
int new_name_len;
|
||||
int n;
|
||||
char *old_name_base = NULL;
|
||||
struct inst_hashentry *entry;
|
||||
Inst_hashentry *entry;
|
||||
|
||||
dbg(1, "new_prop_string(): i=%d, old_prop=%s, fast=%d\n", i, old_prop, fast);
|
||||
if(!fast) { /* on 1st invocation of new_prop_string */
|
||||
|
|
@ -1854,7 +1854,7 @@ void print_tedax_element(FILE *fd, int inst)
|
|||
int token_pos=0, escape=0;
|
||||
int no_of_pins=0;
|
||||
int subcircuit = 0;
|
||||
/* struct inst_hashentry *ptr; */
|
||||
/* Inst_hashentry *ptr; */
|
||||
|
||||
my_strdup(489, &extra, get_tok_value((xctx->inst[inst].ptr+ xctx->sym)->prop_ptr,"extra",0));
|
||||
my_strdup(41, &extra_pinnumber, get_tok_value(xctx->inst[inst].prop_ptr,"extra_pinnumber",0));
|
||||
|
|
@ -2355,7 +2355,7 @@ void print_vhdl_primitive(FILE *fd, int inst) /* netlist primitives, 20071217 *
|
|||
int sizetok=0;
|
||||
int token_pos=0, escape=0;
|
||||
int no_of_pins=0;
|
||||
/* struct inst_hashentry *ptr; */
|
||||
/* Inst_hashentry *ptr; */
|
||||
|
||||
my_strdup(513, &template, (xctx->inst[inst].ptr+ xctx->sym)->templ);
|
||||
my_strdup(514, &name, xctx->inst[inst].instname);
|
||||
|
|
@ -2527,7 +2527,7 @@ void print_verilog_primitive(FILE *fd, int inst) /* netlist switch level primiti
|
|||
int sizetok=0;
|
||||
int token_pos=0, escape=0;
|
||||
int no_of_pins=0;
|
||||
/* struct inst_hashentry *ptr; */
|
||||
/* Inst_hashentry *ptr; */
|
||||
|
||||
my_strdup(519, &template,
|
||||
(xctx->inst[inst].ptr+ xctx->sym)->templ);
|
||||
|
|
@ -2750,7 +2750,7 @@ const char *translate(int inst, const char* s)
|
|||
const char *tmp_sym_name;
|
||||
int sizetok=0;
|
||||
int result_pos=0, token_pos=0;
|
||||
/* struct inst_hashentry *ptr; */
|
||||
/* Inst_hashentry *ptr; */
|
||||
struct stat time_buf;
|
||||
struct tm *tm;
|
||||
char file_name[PATH_MAX];
|
||||
|
|
@ -3029,7 +3029,7 @@ const char *translate(int inst, const char* s)
|
|||
return tcl_hook2(&result);
|
||||
}
|
||||
|
||||
const char *translate2(struct Lcc *lcc, int level, char* s)
|
||||
const char *translate2(Lcc *lcc, int level, char* s)
|
||||
{
|
||||
static const char *empty="";
|
||||
static char *result = NULL;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
#include "xschem.h"
|
||||
static struct str_hashentry *subckt_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
static Str_hashentry *subckt_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
|
||||
void global_verilog_netlist(int global) /* netlister driver */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "xschem.h"
|
||||
|
||||
static struct str_hashentry *subckt_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
static Str_hashentry *subckt_table[HASHSIZE]; /* safe even with multiple schematics */
|
||||
|
||||
void global_vhdl_netlist(int global) /* netlister driver */
|
||||
{
|
||||
|
|
|
|||
10
src/xinit.c
10
src/xinit.c
|
|
@ -469,11 +469,11 @@ void alloc_xschem_data(const char *top_path)
|
|||
xctx->inst_spatial_table[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
xctx->node_table = my_calloc(517, HASHSIZE, sizeof(struct node_hashentry *));
|
||||
xctx->node_redraw_table = my_calloc(973, HASHSIZE, sizeof(struct int_hashentry *));
|
||||
xctx->inst_table = my_calloc(1382, HASHSIZE, sizeof(struct inst_hashentry *));
|
||||
xctx->hilight_table = my_calloc(1383, HASHSIZE, sizeof(struct hilight_hashentry *));
|
||||
xctx->raw_table = my_calloc(1384, HASHSIZE, sizeof(struct int_hashentry *));
|
||||
xctx->node_table = my_calloc(517, HASHSIZE, sizeof(Node_hashentry *));
|
||||
xctx->node_redraw_table = my_calloc(973, HASHSIZE, sizeof(Int_hashentry *));
|
||||
xctx->inst_table = my_calloc(1382, HASHSIZE, sizeof(Inst_hashentry *));
|
||||
xctx->hilight_table = my_calloc(1383, HASHSIZE, sizeof(Hilight_hashentry *));
|
||||
xctx->raw_table = my_calloc(1384, HASHSIZE, sizeof(Int_hashentry *));
|
||||
|
||||
xctx->inst_redraw_table = NULL;
|
||||
xctx->inst_redraw_table_size = 0;
|
||||
|
|
|
|||
417
src/xschem.h
417
src/xschem.h
|
|
@ -337,47 +337,47 @@ do { \
|
|||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short type;
|
||||
int n;
|
||||
unsigned int col;
|
||||
unsigned short type;
|
||||
int n;
|
||||
unsigned int col;
|
||||
} Selected;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double x1;
|
||||
double x2;
|
||||
double y1;
|
||||
double y2;
|
||||
short end1;
|
||||
short end2;
|
||||
short sel;
|
||||
char *node;
|
||||
char *prop_ptr;
|
||||
short bus; /* 20171201 cache here wire "bus" property, to avoid too many get_tok_value() calls */
|
||||
double x1;
|
||||
double x2;
|
||||
double y1;
|
||||
double y2;
|
||||
short end1;
|
||||
short end2;
|
||||
short sel;
|
||||
char *node;
|
||||
char *prop_ptr;
|
||||
short bus; /* 20171201 cache here wire "bus" property, to avoid too many get_tok_value() calls */
|
||||
} xWire;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double x1;
|
||||
double x2;
|
||||
double y1;
|
||||
double y2;
|
||||
unsigned short sel;
|
||||
char *prop_ptr;
|
||||
short dash;
|
||||
short bus;
|
||||
double x1;
|
||||
double x2;
|
||||
double y1;
|
||||
double y2;
|
||||
unsigned short sel;
|
||||
char *prop_ptr;
|
||||
short dash;
|
||||
short bus;
|
||||
} xLine;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double x1;
|
||||
double x2;
|
||||
double y1;
|
||||
double y2;
|
||||
unsigned short sel;
|
||||
char *prop_ptr;
|
||||
short dash;
|
||||
unsigned short flags;
|
||||
double x1;
|
||||
double x2;
|
||||
double y1;
|
||||
double y2;
|
||||
unsigned short sel;
|
||||
char *prop_ptr;
|
||||
short dash;
|
||||
unsigned short flags;
|
||||
} xRect;
|
||||
|
||||
typedef struct
|
||||
|
|
@ -425,54 +425,55 @@ typedef struct
|
|||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
double minx;
|
||||
double maxx;
|
||||
double miny;
|
||||
double maxy;
|
||||
xLine **line; /* array of [cadlayers] pointers to Line */
|
||||
xRect **rect;
|
||||
xPoly **poly;
|
||||
xArc **arc;
|
||||
xText *text;
|
||||
int *lines; /* array of [cadlayers] integers */
|
||||
int *rects;
|
||||
int *polygons;
|
||||
int *arcs;
|
||||
int texts;
|
||||
char *prop_ptr;
|
||||
char *type;
|
||||
char *templ;
|
||||
int flags; /* bit 0: embedded flag
|
||||
* bit 1: **free**
|
||||
* bit 2: highight if connected wire highlighted */
|
||||
char *name;
|
||||
double minx;
|
||||
double maxx;
|
||||
double miny;
|
||||
double maxy;
|
||||
xLine **line; /* array of [cadlayers] pointers to Line */
|
||||
xRect **rect;
|
||||
xPoly **poly;
|
||||
xArc **arc;
|
||||
xText *text;
|
||||
int *lines; /* array of [cadlayers] integers */
|
||||
int *rects;
|
||||
int *polygons;
|
||||
int *arcs;
|
||||
int texts;
|
||||
char *prop_ptr;
|
||||
char *type;
|
||||
char *templ;
|
||||
int flags; /* bit 0: embedded flag
|
||||
* bit 1: **free**
|
||||
* bit 2: highight if connected wire highlighted */
|
||||
} xSymbol;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;/* symbol name (ex: devices/lab_pin) */
|
||||
int ptr; /* was a pointer formerly... */
|
||||
double x0; /* symbol origin / anchor point */
|
||||
double y0;
|
||||
double x1; /* symbol bounding box */
|
||||
double y1;
|
||||
double x2;
|
||||
double y2;
|
||||
double xx1; /* bounding box without texts */
|
||||
double yy1;
|
||||
double xx2;
|
||||
double yy2;
|
||||
short rot;
|
||||
short flip;
|
||||
short sel;
|
||||
int color; /* hilight color */
|
||||
short flags; /* bit 0: skip field,
|
||||
* bit 1: flag for different textlayer for pin/labels , 1: ordinary symbol, 0: label/pin/show
|
||||
* bit 2: highlight if connected net/label is highlighted */
|
||||
char *prop_ptr;
|
||||
char **node;
|
||||
char *lab; /* lab attribute if any (pin/label) */
|
||||
char *instname; /* 20150409 instance name (example: I23) */
|
||||
char *name;/* symbol name (ex: devices/lab_pin) */
|
||||
int ptr; /* was a pointer formerly... */
|
||||
double x0; /* symbol origin / anchor point */
|
||||
double y0;
|
||||
double x1; /* symbol bounding box */
|
||||
double y1;
|
||||
double x2;
|
||||
double y2;
|
||||
double xx1; /* bounding box without texts */
|
||||
double yy1;
|
||||
double xx2;
|
||||
double yy2;
|
||||
short rot;
|
||||
short flip;
|
||||
short sel;
|
||||
int color; /* hilight color */
|
||||
short flags; /* bit 0: skip field,
|
||||
* bit 1: flag for different textlayer for pin/labels,
|
||||
* 1: ordinary symbol, 0: label/pin/show
|
||||
* bit 2: highlight if connected net/label is highlighted */
|
||||
char *prop_ptr;
|
||||
char **node;
|
||||
char *lab; /* lab attribute if any (pin/label) */
|
||||
char *instname; /* 20150409 instance name (example: I23) */
|
||||
} xInstance;
|
||||
|
||||
|
||||
|
|
@ -484,28 +485,19 @@ typedef struct
|
|||
} Zoom;
|
||||
|
||||
|
||||
struct iterator_ctx {
|
||||
int x1a, x2a;
|
||||
int y1a, y2a;
|
||||
int i, j, counti, countj;
|
||||
int tmpi, tmpj;
|
||||
struct instentry *instanceptr;
|
||||
struct wireentry *wireptr;
|
||||
unsigned short *instflag;
|
||||
unsigned short *wireflag;
|
||||
};
|
||||
|
||||
struct simdata_pin {
|
||||
char *function;
|
||||
char *go_to;
|
||||
int value;
|
||||
short clock;
|
||||
};
|
||||
typedef struct
|
||||
{
|
||||
char *function;
|
||||
char *go_to;
|
||||
int value;
|
||||
short clock;
|
||||
} Simdata_pin;
|
||||
|
||||
struct simdata {
|
||||
struct simdata_pin *pin;
|
||||
int npin;
|
||||
};
|
||||
typedef struct
|
||||
{
|
||||
Simdata_pin *pin;
|
||||
int npin;
|
||||
} Simdata;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
@ -532,6 +524,117 @@ typedef struct
|
|||
xSymbol *symptr;
|
||||
} Undo_slot;
|
||||
|
||||
typedef struct
|
||||
{ /* used for symbols containing schematics as instances (LCC, Local Custom Cell) */
|
||||
double x0;
|
||||
double y0;
|
||||
short rot;
|
||||
short flip;
|
||||
FILE *fd;
|
||||
char *prop_ptr;
|
||||
char *symname;
|
||||
} Lcc;
|
||||
|
||||
typedef struct {
|
||||
int in;
|
||||
int out;
|
||||
int inout;
|
||||
int port;
|
||||
} Drivers;
|
||||
|
||||
/* instance name (refdes) hash table, for unique name checking */
|
||||
typedef struct inst_hashentry Inst_hashentry;
|
||||
struct inst_hashentry
|
||||
{
|
||||
struct inst_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
int value;
|
||||
};
|
||||
|
||||
/* generic string hash table */
|
||||
typedef struct str_hashentry Str_hashentry;
|
||||
struct str_hashentry
|
||||
{
|
||||
struct str_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
char *value;
|
||||
};
|
||||
|
||||
/* generic int hash table */
|
||||
typedef struct int_hashentry Int_hashentry;
|
||||
struct int_hashentry
|
||||
{
|
||||
struct int_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
int value;
|
||||
};
|
||||
|
||||
typedef struct node_hashentry Node_hashentry;
|
||||
struct node_hashentry
|
||||
{
|
||||
struct node_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
char *sig_type;
|
||||
char *verilog_type;
|
||||
char *value;
|
||||
char *class;
|
||||
char *orig_tok;
|
||||
Drivers d;
|
||||
};
|
||||
|
||||
|
||||
typedef struct hilight_hashentry Hilight_hashentry;
|
||||
struct hilight_hashentry
|
||||
{
|
||||
struct hilight_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
char *path; /* hierarchy path */
|
||||
int oldvalue; /* used for FF simulation */
|
||||
int value; /* hilight color */
|
||||
int time; /*delta-time for sims */
|
||||
};
|
||||
|
||||
/* for netlist.c */
|
||||
typedef struct instpinentry Instpinentry;
|
||||
struct instpinentry
|
||||
{
|
||||
struct instpinentry *next;
|
||||
double x0,y0;
|
||||
int n;
|
||||
int pin;
|
||||
};
|
||||
|
||||
typedef struct wireentry Wireentry;
|
||||
struct wireentry
|
||||
{
|
||||
struct wireentry *next;
|
||||
int n;
|
||||
};
|
||||
|
||||
typedef struct instentry Instentry;
|
||||
struct instentry
|
||||
{
|
||||
struct instentry *next;
|
||||
int n;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x1a, x2a;
|
||||
int y1a, y2a;
|
||||
int i, j, counti, countj;
|
||||
int tmpi, tmpj;
|
||||
Instentry *instanceptr;
|
||||
Wireentry *wireptr;
|
||||
unsigned short *instflag;
|
||||
unsigned short *wireflag;
|
||||
} Iterator_ctx;
|
||||
|
||||
typedef struct {
|
||||
xWire *wire;
|
||||
xText *text;
|
||||
|
|
@ -591,7 +694,7 @@ typedef struct {
|
|||
int prep_hi_structs;
|
||||
int prep_hash_inst;
|
||||
int prep_hash_wires;
|
||||
struct simdata *simdata;
|
||||
Simdata *simdata;
|
||||
int simdata_ninst;
|
||||
int modified;
|
||||
int semaphore;
|
||||
|
|
@ -600,9 +703,9 @@ typedef struct {
|
|||
int flat_netlist;
|
||||
char current_dirname[PATH_MAX];
|
||||
int netlist_unconn_cnt; /* unique count of unconnected pins while netlisting */
|
||||
struct instpinentry *instpin_spatial_table[NBOXES][NBOXES];
|
||||
struct wireentry *wire_spatial_table[NBOXES][NBOXES];
|
||||
struct instentry *inst_spatial_table[NBOXES][NBOXES];
|
||||
Instpinentry *instpin_spatial_table[NBOXES][NBOXES];
|
||||
Wireentry *wire_spatial_table[NBOXES][NBOXES];
|
||||
Instentry *inst_spatial_table[NBOXES][NBOXES];
|
||||
Window window;
|
||||
Pixmap save_pixmap;
|
||||
XRectangle xrect[1];
|
||||
|
|
@ -623,9 +726,9 @@ typedef struct {
|
|||
int cur_undo_ptr;
|
||||
int tail_undo_ptr;
|
||||
int head_undo_ptr;
|
||||
struct inst_hashentry **inst_table;
|
||||
struct node_hashentry **node_table;
|
||||
struct hilight_hashentry **hilight_table;
|
||||
Inst_hashentry **inst_table;
|
||||
Node_hashentry **node_table;
|
||||
Hilight_hashentry **hilight_table;
|
||||
|
||||
int hilight_nets;
|
||||
int hilight_color;
|
||||
|
|
@ -641,7 +744,7 @@ typedef struct {
|
|||
int onetime;
|
||||
/* move.c */
|
||||
/* list of nodes, instances attached to these need redraw */
|
||||
struct int_hashentry **node_redraw_table;
|
||||
Int_hashentry **node_redraw_table;
|
||||
/* list of instances, collected using previous table, that need redraw */
|
||||
unsigned char *inst_redraw_table;
|
||||
int inst_redraw_table_size;
|
||||
|
|
@ -700,7 +803,7 @@ typedef struct {
|
|||
int graph_master; /* graph where mouse operations are started, used to lock x-axis */
|
||||
int graph_bottom; /* graph where mouse operations are started, used to lock x-axis */
|
||||
int graph_left; /* graph where mouse operations are started, used to lock x-axis */
|
||||
struct int_hashentry **raw_table;
|
||||
Int_hashentry **raw_table;
|
||||
char *raw_schname;
|
||||
/* */
|
||||
int nl_sel, nl_sem;
|
||||
|
|
@ -740,88 +843,6 @@ typedef struct {
|
|||
void (*clear_undo)(void);
|
||||
} Xschem_ctx;
|
||||
|
||||
struct Lcc { /* used for symbols containing schematics as instances (LCC, Local Custom Cell) */
|
||||
double x0;
|
||||
double y0;
|
||||
short rot;
|
||||
short flip;
|
||||
FILE *fd;
|
||||
char *prop_ptr;
|
||||
char *symname;
|
||||
};
|
||||
|
||||
struct drivers {
|
||||
int in;
|
||||
int out;
|
||||
int inout;
|
||||
int port;
|
||||
};
|
||||
|
||||
/* instance name (refdes) hash table, for unique name checking */
|
||||
struct inst_hashentry {
|
||||
struct inst_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
int value;
|
||||
};
|
||||
|
||||
/* generic string hash table */
|
||||
struct str_hashentry {
|
||||
struct str_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
char *value;
|
||||
};
|
||||
|
||||
/* generic int hash table */
|
||||
struct int_hashentry {
|
||||
struct int_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
int value;
|
||||
};
|
||||
|
||||
struct node_hashentry {
|
||||
struct node_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
char *sig_type;
|
||||
char *verilog_type;
|
||||
char *value;
|
||||
char *class;
|
||||
char *orig_tok;
|
||||
struct drivers d;
|
||||
};
|
||||
|
||||
|
||||
struct hilight_hashentry {
|
||||
struct hilight_hashentry *next;
|
||||
unsigned int hash;
|
||||
char *token;
|
||||
char *path; /* hierarchy path */
|
||||
int oldvalue; /* used for FF simulation */
|
||||
int value; /* hilight color */
|
||||
int time; /*delta-time for sims */
|
||||
};
|
||||
|
||||
/* for netlist.c */
|
||||
struct instpinentry {
|
||||
struct instpinentry *next;
|
||||
double x0,y0;
|
||||
int n;
|
||||
int pin;
|
||||
};
|
||||
|
||||
struct wireentry {
|
||||
struct wireentry *next;
|
||||
int n;
|
||||
};
|
||||
|
||||
struct instentry {
|
||||
struct instentry *next;
|
||||
int n;
|
||||
};
|
||||
|
||||
/* GLOBAL VARIABLES */
|
||||
|
||||
/*********** X11 specific globals ***********/
|
||||
|
|
@ -931,8 +952,8 @@ extern void saveas(const char *f, int type);
|
|||
extern const char *get_file_path(char *f);
|
||||
extern int save(int confirm);
|
||||
extern void save_ascii_string(const char *ptr, FILE *fd, int newline);
|
||||
extern struct hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int what) ;
|
||||
extern struct hilight_hashentry *hilight_lookup(const char *token, int value, int what);
|
||||
extern Hilight_hashentry *bus_hilight_hash_lookup(const char *token, int value, int what) ;
|
||||
extern Hilight_hashentry *hilight_lookup(const char *token, int value, int what);
|
||||
extern int name_strcmp(char *s, char *d) ;
|
||||
extern int search(const char *tok, const char *val, int sub, int sel);
|
||||
extern int process_options(int argc, char **argv);
|
||||
|
|
@ -1146,26 +1167,26 @@ extern int tclvareval(const char *script, ...);
|
|||
extern const char *tcl_hook2(char **res);
|
||||
extern void statusmsg(char str[],int n);
|
||||
extern int place_text(int draw_text, double mx, double my);
|
||||
extern void init_inst_iterator(struct iterator_ctx *ctx, double x1, double y1, double x2, double y2);
|
||||
extern struct instentry *inst_iterator_next(struct iterator_ctx *ctx);
|
||||
extern void init_wire_iterator(struct iterator_ctx *ctx, double x1, double y1, double x2, double y2);
|
||||
extern struct wireentry *wire_iterator_next(struct iterator_ctx *ctx);
|
||||
extern void init_inst_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, double y2);
|
||||
extern Instentry *inst_iterator_next(Iterator_ctx *ctx);
|
||||
extern void init_wire_iterator(Iterator_ctx *ctx, double x1, double y1, double x2, double y2);
|
||||
extern Wireentry *wire_iterator_next(Iterator_ctx *ctx);
|
||||
extern void check_unique_names(int rename);
|
||||
|
||||
extern void clear_instance_hash();
|
||||
|
||||
extern unsigned int str_hash(const char *tok);
|
||||
extern void str_hash_free(struct str_hashentry **table);
|
||||
extern struct str_hashentry *str_hash_lookup(struct str_hashentry **table,
|
||||
extern void str_hash_free(Str_hashentry **table);
|
||||
extern Str_hashentry *str_hash_lookup(Str_hashentry **table,
|
||||
const char *token, const char *value, int what);
|
||||
extern void int_hash_free(struct int_hashentry **table);
|
||||
extern struct int_hashentry *int_hash_lookup(struct int_hashentry **table,
|
||||
extern void int_hash_free(Int_hashentry **table);
|
||||
extern Int_hashentry *int_hash_lookup(Int_hashentry **table,
|
||||
const char *token, const int value, int what);
|
||||
|
||||
extern const char *find_nth(const char *str, char sep, int n);
|
||||
extern int isonlydigit(const char *s);
|
||||
extern const char *translate(int inst, const char* s);
|
||||
extern const char* translate2(struct Lcc *lcc, int level, char* s);
|
||||
extern const char* translate2(Lcc *lcc, int level, char* s);
|
||||
extern void print_tedax_element(FILE *fd, int inst);
|
||||
extern int print_spice_element(FILE *fd, int inst);
|
||||
extern void print_spice_subckt(FILE *fd, int symbol);
|
||||
|
|
@ -1230,7 +1251,7 @@ extern int count_items(const char *s, const char *sep);
|
|||
extern int get_unnamed_node(int what, int mult, int node);
|
||||
extern void node_hash_free(void);
|
||||
extern void traverse_node_hash();
|
||||
extern struct node_hashentry
|
||||
extern Node_hashentry
|
||||
*bus_node_hash_lookup(const char *token, const char *dir,int what, int port, char *sig_type,
|
||||
char *verilog_type, char *value, char *class);
|
||||
/* extern void insert_missing_pin(); */
|
||||
|
|
@ -1259,7 +1280,7 @@ extern void clear_all_hilights(void);
|
|||
extern void hilight_child_pins(void);
|
||||
extern void hilight_parent_pins(void);
|
||||
extern void hilight_net_pin_mismatches(void);
|
||||
extern struct node_hashentry **get_node_table_ptr(void);
|
||||
extern Node_hashentry **get_node_table_ptr(void);
|
||||
extern void change_elem_order(void);
|
||||
extern int set_different_token(char **s,const char *new, const char *old, int object, int n);
|
||||
extern void print_hilight_net(int show);
|
||||
|
|
|
|||
|
|
@ -162,9 +162,9 @@ proc netlist_test {} {
|
|||
greycnt.sch verilog 3391559642
|
||||
autozero_comp.sch spice 2011673313
|
||||
loading.sch vhdl 2601437773
|
||||
mos_power_ampli.sch spice 1186348644
|
||||
mos_power_ampli.sch spice 2488555251
|
||||
hierarchical_tedax.sch tedax 998070173
|
||||
LCC_instances.sch spice 3338289986
|
||||
LCC_instances.sch spice 3917186717
|
||||
pcb_test1.sch tedax 1295717013
|
||||
simulate_ff.sch spice 1321596936
|
||||
} {
|
||||
|
|
|
|||
Loading…
Reference in New Issue