Hey, I was trying to create a Verilog scheme by modifying the cpp.scheme. There's something weird with the highlighting. In verilog you can write numbers as 4'b1011 ...meaning a 4 bit binary number 1010(binary)=11(dec). But the scheme seems to think that the apostrophe character is the end of the line, so everything from the ' to the end of the line ends up highlighted in light purple. How can I get programmer's notepad to recognize the ' as part of a number? Thanx
Verilog scheme question
(8 posts) (4 voices)-
Posted 5 years ago #
-
The quote symbol is used to start a character string in c++, so that's why the state is changing at that point.
PN has a built-in lexer for verilog, it's just not used yet! Try changing the lexer line to use "verilog" and see how that goes. The style numbers may not be the same. If it looks a little weird, let me know and I'll try and dig up the styles. I'd be interested in including this scheme with PN when it's finished!
Posted 5 years ago # -
Thanks a lot for the quick reply. The verilog lexer seems to be working. Here's what I have so far:
<?xml version="1.0" encoding="UTF-8"?>
<Scheme>
<keyword-classes>
<keyword-class name="verilog">
always and assign attribute begin buf bufif0 bufif1 case casex
casez cmos deassign default defparam disable edge else end
endattribute endcase endfunction endmodule endprimitive endspecify
endtable endtask event for force forever fork function highz0 highz1
if ifnone initial inout input integer join medium module large
macromodule nand negedge nmos nor not notif0 notif1 or output
parameter pmos posedge primitive pull0 pull1 pulldown pullup rcmos
real realtime reg release repeat rnmos rpmos rtran rtranif0 rtranif1
scalared signed small specify specparam strength strong0 strong1
supply0 supply1 table task time tran tranif0 tranif1 tri tri0 tri1
triand trior trireg unsigned vectored wait wand weak0 weak1 while
wire wor xnor xor
</keyword-class>
</keyword-classes><!-- base scheme for verilog style languages -->
<base-language name="verilogbase">
<lexer name="verilog" />
<use-styles>
<style name="Default" key="32" />
<style name="Whitespace" key="0" />
<style name="Comment" key="1" class="commentbox"/>
<style name="Comment Line" key="2" class="commentline"/><style name="Number" key="4" fore="colour.number"/>
<style name="Keyword" key="5" class="keyword"/>
<style name="String" key="6" fore="colour.string"/>
<style name="Character" key="7" fore="colour.char"/><style name="Operator" key="10" bold="true"/>
<style name="Identifier" key="11" />
<style name="End of line string" key="12" fore="000000" font="font.monospace" back="e0c0e0" eolfilled="true"/>
</use-styles>
</base-language><language base="verilogbase" name="verilog" title="Verilog" folding="true">
<use-keywords>
<keyword key="0" name="Keywords" class="verilog" />
</use-keywords>
</language>
</Scheme>
Posted 5 years ago # -
Great, glad it's working for you. Also note that you don't need to use
base-languageunless multiple schemes will derive from the basic verilog one. Therefore all of your information can go in thelanguageblock and you can remove thebaseattribute.Posted 5 years ago # -
that's great, but there are some mistakes: "attribute" "endattribute" and "signed" are not Verilog reserved keywords (that's according to ModelSim) and should then be removed.
I'll write (when I got some time) a scheme that takes same colours of ModelSim, it is much more easy to edit with programmers notepad!!
Posted 5 years ago # -
I have cleaned this up and added the missing styles for the next release of PN. Thanks!
Posted 4 years ago # -
I see a verilog scheme included with the latest version of PN but how do I use it? If I open up a verilog file anc choose "View -> Change Scheme" verilog is not listed, even though I can go to "Tools -> Options -> Schemes and see it listed there. How do I use the scheme?
Posted 4 years ago # -
Ahhhh nevermind. I noticed an old verilog.scheme file in the schemes dir that mist have been conflicting with the newer version.
Posted 4 years ago #
Reply
You must log in to post.