If variable ps_port_directions >= 2, also show the translated Xspice statements.
This commit is contained in:
parent
0e0daa7d9a
commit
f0876163e8
|
|
@ -58,11 +58,6 @@
|
||||||
extern struct card* insert_new_line(
|
extern struct card* insert_new_line(
|
||||||
struct card* card, char* line, int linenum, int linenum_orig);
|
struct card* card, char* line, int linenum, int linenum_orig);
|
||||||
|
|
||||||
/*
|
|
||||||
When TRACE is defined, the Pspice input lines are printed with
|
|
||||||
prefix TRANS_IN, and the translated Xspice equivalent lines are
|
|
||||||
printed with prefix TRANS_OUT. Also, the name lists are dumped.
|
|
||||||
*/
|
|
||||||
//#define TRACE
|
//#define TRACE
|
||||||
|
|
||||||
/* device types */
|
/* device types */
|
||||||
|
|
@ -290,7 +285,7 @@ static void print_name_list(NAME_ENTRY nelist)
|
||||||
static data cleared and reset by initialize_udevice(),
|
static data cleared and reset by initialize_udevice(),
|
||||||
cleared by cleanup_udevice().
|
cleared by cleanup_udevice().
|
||||||
*/
|
*/
|
||||||
static int port_directions = 0; // If non-zero list subckt port directions
|
static int ps_port_directions = 0; // If non-zero list subckt port directions
|
||||||
static NAME_ENTRY new_names_list = NULL;
|
static NAME_ENTRY new_names_list = NULL;
|
||||||
static NAME_ENTRY input_names_list = NULL;
|
static NAME_ENTRY input_names_list = NULL;
|
||||||
static NAME_ENTRY output_names_list = NULL;
|
static NAME_ENTRY output_names_list = NULL;
|
||||||
|
|
@ -382,13 +377,11 @@ static void add_all_port_names(char *subckt_line)
|
||||||
if (!subckt_line) {
|
if (!subckt_line) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef TRACE
|
if (ps_port_directions >= 2) {
|
||||||
printf("TRANS_IN %s\n", subckt_line);
|
printf("TRANS_IN %s\n", subckt_line);
|
||||||
#else
|
} else if (ps_port_directions) {
|
||||||
if (port_directions) {
|
|
||||||
printf("%s\n", subckt_line);
|
printf("%s\n", subckt_line);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
copy_line = tprintf("%s", subckt_line);
|
copy_line = tprintf("%s", subckt_line);
|
||||||
pos = strstr(copy_line, "optional:");
|
pos = strstr(copy_line, "optional:");
|
||||||
if (pos) {
|
if (pos) {
|
||||||
|
|
@ -404,9 +397,6 @@ static void add_all_port_names(char *subckt_line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef TRACE
|
|
||||||
printf("%s\n", copy_line);
|
|
||||||
#endif
|
|
||||||
/* skip past .subckt and its name */
|
/* skip past .subckt and its name */
|
||||||
tok = strtok(copy_line, " \t");
|
tok = strtok(copy_line, " \t");
|
||||||
tok = strtok(NULL, " \t");
|
tok = strtok(NULL, " \t");
|
||||||
|
|
@ -726,9 +716,9 @@ struct card *replacement_udevice_cards(void)
|
||||||
translated_p = add_xlator(translated_p, x);
|
translated_p = add_xlator(translated_p, x);
|
||||||
}
|
}
|
||||||
for (x = first_xlator(translated_p); x; x = next_xlator(translated_p)) {
|
for (x = first_xlator(translated_p); x; x = next_xlator(translated_p)) {
|
||||||
#ifdef TRACE
|
if (ps_port_directions >= 2) {
|
||||||
printf("TRANS_OUT %s\n", x->translated);
|
printf("TRANS_OUT %s\n", x->translated);
|
||||||
#endif
|
}
|
||||||
new_str = copy(x->translated);
|
new_str = copy(x->translated);
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
count++;
|
count++;
|
||||||
|
|
@ -741,9 +731,6 @@ struct card *replacement_udevice_cards(void)
|
||||||
nextcard = insert_new_line(nextcard, new_str, 0, 0);
|
nextcard = insert_new_line(nextcard, new_str, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef TRACE
|
|
||||||
printf("TRANS_OUT\n");
|
|
||||||
#endif
|
|
||||||
return newcard;
|
return newcard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -757,9 +744,14 @@ void initialize_udevice(char *subckt_line)
|
||||||
tristate_names_list = NULL;
|
tristate_names_list = NULL;
|
||||||
port_names_list = NULL;
|
port_names_list = NULL;
|
||||||
num_name_collisions = 0;
|
num_name_collisions = 0;
|
||||||
/* Variable ps_port_directions != 0 to turn on pins and ports */
|
/*
|
||||||
if (!cp_getvar("ps_port_directions", CP_NUM, &port_directions, 0)) {
|
Variable ps_port_directions != 0 to turn on pins and ports.
|
||||||
port_directions = 0;
|
If ps_port_directions >= 2 also print the Pspice input lines with
|
||||||
|
prefix TRANS_IN, and the translated Xspice equivalent lines
|
||||||
|
with prefix TRANS_OUT.
|
||||||
|
*/
|
||||||
|
if (!cp_getvar("ps_port_directions", CP_NUM, &ps_port_directions, 0)) {
|
||||||
|
ps_port_directions = 0;
|
||||||
}
|
}
|
||||||
if (subckt_line && strncmp(subckt_line, ".subckt", 7) == 0) {
|
if (subckt_line && strncmp(subckt_line, ".subckt", 7) == 0) {
|
||||||
add_all_port_names(subckt_line);
|
add_all_port_names(subckt_line);
|
||||||
|
|
@ -812,13 +804,9 @@ static void determine_port_type(void)
|
||||||
port_type = "IN";
|
port_type = "IN";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef TRACE
|
if (ps_port_directions) {
|
||||||
printf("port: %s %s\n", x->name, port_type);
|
|
||||||
#else
|
|
||||||
if (port_directions) {
|
|
||||||
printf("port: %s %s\n", x->name, port_type);
|
printf("port: %s %s\n", x->name, port_type);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3401,10 +3389,9 @@ BOOL u_process_instance(char *nline)
|
||||||
delete_instance_hdr(hdr);
|
delete_instance_hdr(hdr);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#ifdef TRACE
|
if (ps_port_directions >= 2) {
|
||||||
printf("TRANS_IN %s\n", nline);
|
printf("TRANS_IN %s\n", nline);
|
||||||
#endif
|
}
|
||||||
// printf("iname %s itype %s\n", hdr->instance_name, itype);
|
|
||||||
/* Skip past instance name, type, pwr, gnd */
|
/* Skip past instance name, type, pwr, gnd */
|
||||||
p1 = skip_past_words(nline, 4);
|
p1 = skip_past_words(nline, 4);
|
||||||
if (is_gate(itype) || is_gate_array(itype)) {
|
if (is_gate(itype) || is_gate_array(itype)) {
|
||||||
|
|
@ -3446,9 +3433,9 @@ BOOL u_process_model_line(char *line)
|
||||||
|
|
||||||
if (n > 0 && line[n] == '\n') line[n] = '\0';
|
if (n > 0 && line[n] == '\n') line[n] = '\0';
|
||||||
if (strncmp(line, ".model ", strlen(".model ")) == 0) {
|
if (strncmp(line, ".model ", strlen(".model ")) == 0) {
|
||||||
#ifdef TRACE
|
if (ps_port_directions >= 2) {
|
||||||
printf("TRANS_IN %s\n", line);
|
printf("TRANS_IN %s\n", line);
|
||||||
#endif
|
}
|
||||||
newline = TMALLOC(char, strlen(line) + 1);
|
newline = TMALLOC(char, strlen(line) + 1);
|
||||||
(void) memcpy(newline, line, strlen(line) + 1);
|
(void) memcpy(newline, line, strlen(line) + 1);
|
||||||
retval = u_process_model(newline, line);
|
retval = u_process_model(newline, line);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue