Thread: [myhdl-list] OT; Verilog syntax highlighter for GeSHi
Brought to you by:
jandecaluwe
From: Günter D. <dan...@we...> - 2008-05-29 19:41:44
|
Hi Jan, Slightly off topic, but when I was searching for a Verilog syntax highlighter for GeSHi I got a few hits on the myhdl web page. I noticed that you must have some kind of Verilog syntax highlighter going, as all the keywords for Verilog are shown bold. Anyhow, I have created one for GeSHi following somewhat the color scheme used in vim. I have uploaded it to a page and it can be downloaded from this link: http://www.mikrocontroller.net/attachment/35709/verilog.php Cheers, Guenter |
From: Jan D. <ja...@ja...> - 2008-05-29 20:57:46
Attachments:
verilog.php
|
Günter Dannoritzer wrote: > Hi Jan, > > Slightly off topic, but when I was searching for a Verilog syntax > highlighter for GeSHi I got a few hits on the myhdl web page. > > I noticed that you must have some kind of Verilog syntax highlighter > going, as all the keywords for Verilog are shown bold. > > Anyhow, I have created one for GeSHi following somewhat the color scheme > used in vim. > > I have uploaded it to a page and it can be downloaded from this link: > > http://www.mikrocontroller.net/attachment/35709/verilog.php Thanks Guenter, Will you try to get this in the geshi distribution? It's quite some time ago already, but I think I reasoned as follows. Dokuwiki also uses geshi, but geshi had (has) no Verilog support. It had vhdl, so I thought Verilog would soon be available. In the mean time, I used a quick hack for Verilog based on the Python file. I have attached it for your reference. (Note: this is a private hack so the header is not consistent with the content - not for distribution.) I'm sure your file is much more complete and I plan to use it (or, if you get it into geshi, that will happen automatically). Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
From: Günter D. <dan...@we...> - 2008-05-29 21:47:35
|
Jan Decaluwe wrote: ... > > Will you try to get this in the geshi distribution? Yes, I mailed it today to the maintainer. ... > > I'm sure your file is much more complete and I plan to use it (or, > if you get it into geshi, that will happen automatically). I am glad it is of some help. I created it for another web page on which I wrote a Verilog introduction in German. Only strange thing is that it does not use all the colors I specified: http://www.mikrocontroller.net/articles/Verilog It will be interesting to see how it looks on the myhdl page. Guenter |
From: Jan D. <ja...@ja...> - 2008-06-05 17:56:15
|
Günter Dannoritzer wrote: > > I am glad it is of some help. I created it for another web page on which > I wrote a Verilog introduction in German. Only strange thing is that it > does not use all the colors I specified: > > http://www.mikrocontroller.net/articles/Verilog > > It will be interesting to see how it looks on the myhdl page. I have now included your file. Not sure this is what you'd expect. I also see something strange with rendering constants like 1'b0. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
From: Günter D. <dan...@we...> - 2008-06-05 18:06:28
|
Jan Decaluwe wrote: ... > > I have now included your file. Not sure this is what you'd expect. > I also see something strange with rendering constants like 1'b0. The keywords are actually to be brown. There must be something else, like from the color scheme of the web page that takes over and adjusts the used colors? I haven't found a constants like 1'b0 on the web page yet. Still looking. They should be all the color like a single number, like 0. Guenter |
From: Jan D. <ja...@ja...> - 2008-06-05 19:50:09
|
Günter Dannoritzer wrote: > Jan Decaluwe wrote: > ... > >>I have now included your file. Not sure this is what you'd expect. >>I also see something strange with rendering constants like 1'b0. > > > The keywords are actually to be brown. There must be something else, > like from the color scheme of the web page that takes over and adjusts > the used colors? Mm, I remember vaguely that dokuwiki does something like that, I'll have to look into it more closely. -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Kaboutermansstraat 97, B-3000 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |
From: Günter D. <dan...@we...> - 2008-06-05 20:01:34
|
Jan Decaluwe wrote: > Günter Dannoritzer wrote: ... >> >> The keywords are actually to be brown. There must be something else, >> like from the color scheme of the web page that takes over and adjusts >> the used colors? > > Mm, I remember vaguely that dokuwiki does something like that, > I'll have to look into it more closely. > I have posted a question about that to the GeSHi-devel mailing list. Will see whether I am getting some feed back from there. Guenter |
From: Günter D. <dan...@we...> - 2008-06-05 18:23:52
|
Jan Decaluwe wrote: ... > > I have now included your file. Not sure this is what you'd expect. > I also see something strange with rendering constants like 1'b0. This is odd, I found the Johnson Counter example and see what you are saying. There is something messed up. I took that Verilog code and ran it here with the code through the highlighter and got the following result below. You can put that into an html file and look at it with the browser. (Was not sure whether the mailing list accepts attachments) The highlighting looks fine there. One thing I noticed, the created highlighted html file does not have any html tags, like <header> or <body>. Guenter ---------------------------- <pre class="verilog"><span style="color: #A52A2A; font-weight: bold;">module</span> jc2 <span style="color: #9F79EE;">(</span> goLeft<span style="color: #5D478B;">,</span> goRight<span style="color: #5D478B;">,</span> stop<span style="color: #5D478B;">,</span> clk<span style="color: #5D478B;">,</span> q <span style="color: #9F79EE;">)</span><span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">input</span> goLeft<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">input</span> goRight<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">input</span> stop<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">input</span> clk<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">output</span> <span style="color: #9F79EE;">[</span><span style="color: #ff0055;">3</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span> q<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">reg</span> <span style="color: #9F79EE;">[</span><span style="color: #ff0055;">3</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span> q<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">reg</span> run<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">reg</span> <span style="color: #9F79EE;">[</span><span style="color: #ff0055;">0</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span> dir<span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">always</span> <span style="color: #5D478B;">@</span><span style="color: #9F79EE;">(</span><span style="color: #A52A2A; font-weight: bold;">posedge</span> clk<span style="color: #9F79EE;">)</span> <span style="color: #A52A2A; font-weight: bold;">begin</span><span style="color: #5D478B;">:</span> _jc2_logic <span style="color: #A52A2A; font-weight: bold;">if</span> <span style="color: #9F79EE;">(</span><span style="color: #9F79EE;">(</span>goRight <span style="color: #5D478B;">==</span> <span style="color: #ff0055;">0</span><span style="color: #9F79EE;">)</span><span style="color: #9F79EE;">)</span> <span style="color: #A52A2A; font-weight: bold;">begin</span> dir <span style="color: #5D478B;"><=</span> <span style="color: #ff0055;"><span style="color: #ff0055;">1</span>'b0</span><span style="color: #5D478B;">|>;</span> run <span style="color: #5D478B;"><=</span> <span style="color: #ff0055;">1</span><span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">else</span> <span style="color: #A52A2A; font-weight: bold;">if</span> <span style="color: #9F79EE;">(</span><span style="color: #9F79EE;">(</span>goLeft <span style="color: #5D478B;">==</span> <span style="color: #ff0055;">0</span><span style="color: #9F79EE;">)</span><span style="color: #9F79EE;">)</span> <span style="color: #A52A2A; font-weight: bold;">begin</span> dir <span style="color: #5D478B;"><=</span> <span style="color: #ff0055;"><span style="color: #ff0055;">1</span>'b1</span><span style="color: #5D478B;">|>;</span> run <span style="color: #5D478B;"><=</span> <span style="color: #ff0055;">1</span><span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">if</span> <span style="color: #9F79EE;">(</span><span style="color: #9F79EE;">(</span>stop <span style="color: #5D478B;">==</span> <span style="color: #ff0055;">0</span><span style="color: #9F79EE;">)</span><span style="color: #9F79EE;">)</span> <span style="color: #A52A2A; font-weight: bold;">begin</span> run <span style="color: #5D478B;"><=</span> <span style="color: #ff0055;">0</span><span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">if</span> <span style="color: #9F79EE;">(</span>run<span style="color: #9F79EE;">)</span> <span style="color: #A52A2A; font-weight: bold;">begin</span> <span style="color: #00008B; font-style: italic;">// synthesis parallel_case full_case</span> <span style="color: #A52A2A; font-weight: bold;">casez</span> <span style="color: #9F79EE;">(</span>dir<span style="color: #9F79EE;">)</span> <span style="color: #ff0055;"><span style="color: #ff0055;">1</span>'b1</span><span style="color: #5D478B;">|>:</span> <span style="color: #A52A2A; font-weight: bold;">begin</span> q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">4</span><span style="color: #ff0055;">-1</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">1</span><span style="color: #9F79EE;">]</span> <span style="color: #5D478B;"><=</span> q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">3</span><span style="color: #ff0055;">-1</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span><span style="color: #5D478B;">;</span> q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span> <span style="color: #5D478B;"><=</span> <span style="color: #9F79EE;">(</span><span style="color: #5D478B;">!</span>q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">3</span><span style="color: #9F79EE;">]</span><span style="color: #9F79EE;">)</span><span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">default</span><span style="color: #5D478B;">:</span> <span style="color: #A52A2A; font-weight: bold;">begin</span> q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">3</span><span style="color: #ff0055;">-1</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span> <span style="color: #5D478B;"><=</span> q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">4</span><span style="color: #ff0055;">-1</span><span style="color: #5D478B;">:</span><span style="color: #ff0055;">1</span><span style="color: #9F79EE;">]</span><span style="color: #5D478B;">;</span> q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">3</span><span style="color: #9F79EE;">]</span> <span style="color: #5D478B;"><=</span> <span style="color: #9F79EE;">(</span><span style="color: #5D478B;">!</span>q<span style="color: #9F79EE;">[</span><span style="color: #ff0055;">0</span><span style="color: #9F79EE;">]</span><span style="color: #9F79EE;">)</span><span style="color: #5D478B;">;</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">endcase</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">end</span> <span style="color: #A52A2A; font-weight: bold;">endmodule</span> </pre> |