Qucs / ADMS

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

Request String Manipulation Support #74

Open appwagner opened 7 years ago

appwagner commented 7 years ago

Hi All,

I was wondering if it would be possible to add string manipulation support to admst ala, https://www.w3schools.com/xml/xsl_functions.asp . Specifically the substring and compare functions would be very useful. The context for my request is that I'm writing xml templates to translate Verilog arrays into std::vectors for a Verilog to SPICE translation. The problem I run into is that in an expression like

myvar = myarray[5];

myarray[5] has datatypename array with name myarray[5], its not a /module/variable with sizetype array. This makes finding the appropriate instance or model scope objects that reference myarray[5] challenging. If some string manipulation was supported it would be straight forward to remove the [5] from the datatypename and compare it to a list of model or instance variables in my model for appropriate translation. The code for adms is not that long and pretty clearly written, its not difficult to see that adding a new transform would involve declaring something like

static void Xmyxform (p_transform mytransform,p_admst dot,p_admst dotdot)

and writing in the appropriate manipulation. Unfortunately I lack a good understanding of the adms api (data structures ect.) so figuring how to do this completely on my own will take some time. If anyone can give me a little overview of the code, I think I could take it from there and would be happy to contribute to the project. Thanks very much for your help.

Cheers,

Andrew