[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  SystemPerl
  Voneline
  WFH
General Info
  Papers

Did anyone ever use the Parser as a stand-alone SV parser in a C++ project?

Added by Jan Seyler about 1 year ago

Hey there,

did anyone ever use the Parser of Verilog-Perl outside of Verilog-Perl in an autonomous C++ application? I'm trying to do this right now and I have some problems creating an instance of the Parser and using it.

It would be great if someone could help me!

Thanking you in anticipation


Replies (64)

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Wilson Snyder 11 months ago

Please file a "support UVM" or alternatively "don't require types predefined" bug and I'll follow up there.

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Hey,

I just opened a ticket. But to get a workaround for now (what I need pretty bad right now). What kind of callbacks can be triggered trought the CALLBACK method in the lex file? Is it possible to do something like
  "endfunction"        { FL; VALTEXT; CALLBACK(endtaskfuncCb); return yENDFUNCTION; }

Thank you so much!!

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Wilson Snyder 11 months ago

Yes, why not just try it? The lexer is at least one symbol ahead of the parser, so it might not do what you want.

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Hey,

it works this way. But it would be nicer to have it in the parser instead of the lexer. Is it somehow possible to tell the parser, that a tf_port_list can include data_types from the symtable? So it can include predefined classes? So if I add a

class uvm_component;
endclass

The function is parsed correctly and furthermore correctly in the datastructure?

I really appreciate your help! Thank you!!

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Another question just appeared:

What is VParseGrammar used for? In my program I derived My_Parser from VParse and use this in my Parser. Now I just saw, I could do something like VParseGrammar(VParse* pp) What is the additional uses of this?

Thanks

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Wilson Snyder 11 months ago

That's where the bison grammar is generated, you're using it under the covers.

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Ok, that's what I thought.

Any thought about the parsing of classes and functions, that have variables with a class as datatype in the portlist?

Thanks

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Wilson Snyder 11 months ago

As I said above, you need to predeclare the data type.

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Thanks,

where may I do it? Declare it as a keyword? Isn't ist possible to use the already parsed data_types like you do with the varCb?

Regards

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Wilson Snyder 11 months ago

Predeclare, as in make the "class foo; endclass" you showed above.

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Yeah, that's what I did, but unfortunately, then not even the functionCb is called... I don't know why, but it does not work. Seems like the portlist in a function declaration only accepts standard types.

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Here you can see, what happens. I added the log files and the parsed files.

Thanks

htax_rx_config.sv (1.5 kB)

htax_item.sv (2.5 kB)

log.txt (116.1 kB)

log_with_class_decl.txt (115.9 kB)

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

The problem appears with both classes and for the new() function of the config-file. You can see it in the log file in line 443 and in the log_with_... file in line 444

Thanks for any reply

RE: Did anyone ever use the Parser as a stand-alone SV parser in a C++ project? - Added by Jan Seyler 11 months ago

Hey,

is it possible, that the -> operator is missing in the lexer, because it is causing troubles with my assertions.

Regards

« Previous 1 2 3 (51-64/64)