-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What to do with mapply_unary? #71
Comments
try var1=+5.6. that should also get you a mapply_unary. note that no processing has been done. you get the structure as emitted by the parser. in these cases that is "a unary operator" applied to "the constant 5.6". |
And how do i avoid it? I mean i need to use variables that are negative. |
what are you trying to achieve? with adms you can essentially print out stuff in different ways. you may use some conditionals. e.g. "if it's a number, print that", if it's a "mapply_unary", print the sign, then print the argument (if it's a number). otherwise print an error... |
First of all, thanks for helping me. My problem is that i yet did not understand the structure of the tree. If there would be a way to print the whole tree :/. |
doesnt |
Obviously not or i doing it wrong. <admst:for-each select="/"> <admst:message format="%(.)\n"/> --> no output Is there a new tutorial beside the one for version 2.2.4? |
You should look at the script "vlatovla.xml" in the ADMS/scripts directory. It will read a verilog module, process it, and write out an equivalent verilog file. The script has all sorts of templates that demonstrate how things like mapply_unary should be handled. You have to realize in something like 'variable=-5" that the thing on the RHS isn't a number as far as ADMS is concerned. It's a unary operator (mapply_unary) taking a single argument. In order to generate code from that, you have to handle mapply_unary, read its argument, and emit what you want to emit (in your case, exactly "-5"). Nothing is easy to do in ADMS. If you look at the vlatovla.xml script, you can begin to understand how you will have to structure your loops and what templates to apply just to emit exactly the same thing that you were inputting. |
The "vlatovla.xml" helped me alot. Thank you! |
I'm still trying to figure out how to read the tree as the example script are, for me, not very useful to really understand how to get all the data from the tree.
One of the first problems that appears is that variables like var1=5.6 are saved as a number element while variables like var2=-3.5 are of type mapply_unary. The happens also when i use the example scripts that come with adms.
I never felt so lost :(
The text was updated successfully, but these errors were encountered: