symbol attribute @symname will display symbol name without extension as it used to be in earlier versions. @symname_ext will print full rootname of symbol. Some doc updates on symbol attributes
This commit is contained in:
parent
470f452caf
commit
c5f412bdb7
|
|
@ -33,13 +33,16 @@ p{padding: 15px 30px 10px;}
|
|||
<li><kbd>subcircuit</kbd>: the symbol has an underlining schematic representation,
|
||||
when producing the netlist XSCHEM has to descend into the corresponding schematic.
|
||||
This will be covered in the subcircuits chapter. </li>
|
||||
<li><kbd>primitive</kbd>: the symbol has a schematic representation but the netlister
|
||||
<li><kbd>primitive</kbd>: the symbol has a schematic representation, you can descend into it but the netlister
|
||||
will not use it. This is very useful if you want to netlist a symbol using only
|
||||
the <kbd>format</kbd> (or <kbd>vhdl_format</kbd> or <kbd>verilog_format</kbd> depending
|
||||
on the netlist type) attribute or use the underlying schematic. By setting the
|
||||
attribute back to <kbd>subcircuit</kbd> you can quickly change the behavior.</li>
|
||||
attribute back to <kbd>subcircuit</kbd> and deleting (or setting to <kbd>false</kbd>) the
|
||||
<kbd>verilog_format</kbd> of <kbd>vhdl_format</kbd> attribute you can quickly change the behavior.
|
||||
For spice netlists the <kbd>format</kbd> attribute is always used also for subcircuits
|
||||
instantiation so always leave it there.</li>
|
||||
<li> Any value different from <kbd>subcircuit</kbd> or <kbd>primitive</kbd> will cause xschem to not use any schematic
|
||||
file even if it exists.</li>
|
||||
file even if it exists. Xschem will not allow to descend into an existing schematic.</li>
|
||||
<li><kbd>label</kbd>: the symbol is used to label a net. These type of symbols must have
|
||||
one and only one pin, and the template string must define a <kbd>lab</kbd> attribute
|
||||
that is passed at component instantiationi to name the net it is attached to. </li>
|
||||
|
|
|
|||
23
src/token.c
23
src/token.c
|
|
@ -2466,7 +2466,7 @@ char *translate(int inst, char* s)
|
|||
memcpy(result+result_pos, value, tmp+1); /* 20180923 */
|
||||
result_pos+=tmp;
|
||||
} else if(strcmp(token,"@symname")==0) {
|
||||
tmp_sym_name=get_cell_w_ext(inst_ptr[inst].name, 0);
|
||||
tmp_sym_name=inst_ptr[inst].name ? get_cell(inst_ptr[inst].name, 0) : "";
|
||||
tmp=strlen(tmp_sym_name);
|
||||
if(result_pos + tmp>=size) {
|
||||
size=(1+(result_pos + tmp) / CADCHUNKALLOC) * CADCHUNKALLOC;
|
||||
|
|
@ -2474,6 +2474,16 @@ char *translate(int inst, char* s)
|
|||
}
|
||||
memcpy(result+result_pos,tmp_sym_name, tmp+1); /* 20180923 */
|
||||
result_pos+=tmp;
|
||||
} else if(strcmp(token,"@symname_ext")==0) {
|
||||
tmp_sym_name=inst_ptr[inst].name ? get_cell_w_ext(inst_ptr[inst].name, 0) : "";
|
||||
tmp=strlen(tmp_sym_name);
|
||||
if(result_pos + tmp>=size) {
|
||||
size=(1+(result_pos + tmp) / CADCHUNKALLOC) * CADCHUNKALLOC;
|
||||
my_realloc(531, &result,size);
|
||||
}
|
||||
memcpy(result+result_pos,tmp_sym_name, tmp+1); /* 20180923 */
|
||||
result_pos+=tmp;
|
||||
|
||||
} else if(token[0]=='@' && token[1]=='#') { /* 20180911 */
|
||||
int n;
|
||||
char *pin_attr = my_malloc(532, sizetok * sizeof(char));
|
||||
|
|
@ -2743,6 +2753,16 @@ char* translate2(struct Lcc *lcc, int level, char* s)
|
|||
result_pos += tmp + 1;
|
||||
}
|
||||
else if (strcmp(token, "@symname") == 0) {
|
||||
tmp_sym_name = lcc[level].symname ? get_cell(lcc[level].symname, 0) : "";
|
||||
tmp = strlen(tmp_sym_name);
|
||||
if (result_pos + tmp >= size) {
|
||||
size = (1 + (result_pos + tmp) / CADCHUNKALLOC) * CADCHUNKALLOC;
|
||||
my_realloc(665, &result, size);
|
||||
}
|
||||
memcpy(result + result_pos, tmp_sym_name, tmp + 1);
|
||||
result_pos += tmp;
|
||||
}
|
||||
else if (strcmp(token, "@symname_ext") == 0) {
|
||||
tmp_sym_name = lcc[level].symname ? get_cell_w_ext(lcc[level].symname, 0) : "";
|
||||
tmp = strlen(tmp_sym_name);
|
||||
if (result_pos + tmp >= size) {
|
||||
|
|
@ -2752,6 +2772,7 @@ char* translate2(struct Lcc *lcc, int level, char* s)
|
|||
memcpy(result + result_pos, tmp_sym_name, tmp + 1);
|
||||
result_pos += tmp;
|
||||
}
|
||||
|
||||
if (c == '@') s--;
|
||||
else result[result_pos++] = c;
|
||||
state = XBEGIN;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
v {xschem version=2.9.5_RC5 file_version=1.1}
|
||||
v {xschem version=2.9.7 file_version=1.2}
|
||||
G {type=subcircuit
|
||||
format="@name @pinlist @symname"
|
||||
verilog_stop=true
|
||||
|
|
|
|||
Loading…
Reference in New Issue