Skip to content
Snippets Groups Projects
Commit 196509eb authored by Daniel van der Schuur's avatar Daniel van der Schuur
Browse files

-Added inc_comb.py + description in readme_myHDL.txt.

parent 38b0a3d5
No related branches found
No related tags found
No related merge requests found
from myhdl import *
def inc_comb(nextCount, count, n):
@always(count)
def logic():
# do nothing here
pass
nextCount.driven = "wire"
return logic
inc_comb.verilog_code =\
"""
assign $nextCount = ($count + 1) % $n;
"""
inc_comb.vhdl_code =\
"""
$nextCount <= ($count + 1) mod $n;
"""
def convert():
nextCount = Signal(intbv(0)[8:])
count = Signal(intbv(0)[8:])
toVerilog(inc_comb, nextCount, count, 256 )
toVHDL(inc_comb, nextCount, count, 256)
convert()
......@@ -24,4 +24,5 @@ This dir contains:
-> Creates tb_muxed_block_gens.v (template TB file)
-> Creates pck_myhdl_081.vhd (a package file)
-> Creates muxed_block_gens.vhd
-inc_comb.py: example code from the myHDL Manual, but completed so it generates
output files. It demonstrates how to include user defined code.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment