Daniel
02/20/2023, 9:34 PMStefan Schippers
02/21/2023, 11:08 AMxschem setprop rect 2 0 x1 1e-8
the first number is the rectangle layer and for graphs should be always 2
the second number is the graph number (0, 1, 2, ...) the first created graph is 0, the next is 1 and so on.
to get the graph number position the mouse pointer close to the inner left border, click and see the n = in the status bottom line (1st picture). To get all defined attributes select the graph as expained before and press 'q' (2nd picture)
Examples:
• set end value of graph '1' x axis to 12e-12: xschem setprop rect 2 1 x2 12p
• set initial value of x axis to 2p: xschem setprop rect 2 1 x1 2p
• switch to log scale x: xschem setprop rect 2 1 logx 1
(you need to set the x1 and x2 in log units afterwards).
• Change trace colors (assuming there are 2 traces): xschem setprop rect 2 1 color {6 9}
Currently there is no autoscale command equivalent to the 'f' key, will add that.Stefan Schippers
02/21/2023, 11:14 AMxschem raw_read $netlist_dir/test_ac.raw ac
the TRAN launcher does:
xschem raw_read $netlist_dir/test_ac.raw tran
Daniel
02/25/2023, 9:01 PMDaniel
02/25/2023, 9:05 PMStefan Schippers
02/25/2023, 9:33 PMDaniel
02/25/2023, 9:35 PMStefan Schippers
02/25/2023, 9:43 PMxschem list_tokens [xschem getprop instance M20] 0
name L W ad pd as ps nrd nrs sa sb sd nf mult model spiceprefix
the inner command gets the whole attribute string of M20 (name=M20 W=.. L=.. model=... ....) the outer command extracts the attributes.
All the xschem specific tcl commands are defined in file scheduler.c, if you look at lines looking like this:
else if(!strcmp(argv[1], "list_tokens"))
{
...
}
Of course it is difficult to get the meaning looking into an obscure C file. I will add the documentation asap.Stefan Schippers
02/26/2023, 12:48 PMsource create_graph.tcl
) allows you to create a graph in xschem and full zoom in both directions, using xschem like a waveform viewer.
proc create_graph {rawfile node {analysis tran} {color {4 5 6 7 8 9 10 11 12 13 14}}} {
# clear window if not already empty
xschem clear force
# clear loaded raw file if any
xschem raw_clear
# set current layer to graph layer (grey, layer 2)
xschem set rectcolor 2
# create a 300x400 rectangle
xschem rect 0 -300 400 0
# make it a graph
xschem setprop rect 2 0 flags graph
# read a simulation raw file
xschem raw_read $rawfile $analysis
# add nodes to display
xschem setprop rect 2 0 node $node
# set node colors
xschem setprop rect 2 0 color $color
# make xschem display full the graph rectangle
xschem zoom_full
# full zoom graph data on x axis
xschem setprop rect 2 0 fullxzoom
# full zoom graph data on y axis
xschem setprop rect 2 0 fullyzoom
}
After sourcing the file you call this procedure at the xschem prompt in the following way:
create_graph .xschem/simulations/solar_panel.raw {led panel}
see attached short video.Daniel
02/26/2023, 10:00 PMStefan Schippers
02/26/2023, 10:43 PMif(argc > 5 && c == 2 && !strcmp(argv[5], "fullxzoom")) {
xRect *r = &xctx->rect[c][n];
Graph_ctx *gr = &xctx->graph_struct;
int dataset;
`/ following line was missing, scheduler.c line 2786 /`
setup_graph_data(n, 0, gr);
if(gr->dataset >= 0 && gr->dataset < xctx->graph_datasets) dataset = gr->dataset;
else dataset = -1;
graph_fullxzoom(r, gr, dataset);
}
Daniel
02/26/2023, 11:03 PM