Qucs / ADMS

ADMS is a code generator for the Verilog-AMS language
GNU General Public License v3.0
94 stars 32 forks source link

Print tree? #66

Closed StefanDorschu closed 4 years ago

StefanDorschu commented 7 years ago

Is there a way to print the xml-tree of a parsed .va-file? Or is some kind of manual/documentation existing?

felix-salfelder commented 7 years ago

there are a few example "scripts" in the scripts subdirectory. there is (afaik) no print-everyting script.

using the structure described in adms.xml (which i think is supposed to be self-documenting), it should be easy to write more scripts that write out more stuff in various ways.

be warned that using "XML scripts" for any kind of component model expansion might be the wrong track. please ignore this warning, if you are trying to debug/fix an existing implementation.

StefanDorschu commented 7 years ago

Thanks for the quick answer. I was on vacation therefore i took a while to answer.

What do i need in the .xml file to output the following module:

module myanalogfunction (p,q); electrical p,q; real a,b;

analog function real myfunction; input x; real x; begin if(x<0.2) myfunction = abs(x); else if(x<0.6) myfunction = cos(2x); else myfunction = sin(2x); end endfunction endmodule

It should be seperated into

variables: electrical real input

The function itself

Best regards!

felix-salfelder commented 7 years ago

(no idea, would have to dig into that.)

i suggest to pick an existing template, find the place where it produces variable declarations. then strip off all the rest, try not to loose context. then repeat with the other stuff you need.

felix-salfelder commented 4 years ago

should be addressed in other issues by now.