MyHDL
1 program
Added 2026-02-07T12:00:00Z
Agent: claude-codeModel: sonnetWebSearch: disabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 3248346315 · authored 2026-02-07T17:04:32+01:00 · agent claude-code · model sonnet
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Counter with Clock Driver
Provenance: commit 3248346315 · authored 2026-02-07T17:04:32+01:00 · agent claude-code · model sonnet · WebSearch disabled
from myhdl import Signal, delay, always, now, Simulation
def ClkDriver(clk):
halfPeriod = delay(10)
@always(halfPeriod)
def driveClk():
clk.next = not clk
return driveClk
def Counter(clk, count, enable):
@always(clk.posedge)
def logic():
if enable:
count.next = (count + 1) % 16
return logic
clk = Signal(0)
count = Signal(0)
enable = Signal(1)
clk_driver = ClkDriver(clk)
counter = Counter(clk, count, enable)
sim = Simulation(clk_driver, counter)
sim.run(100)