
Institution: FH Kärnten
Course: Digital-1
Program: Integrated Systems & Circuit Design
This design is a 10-bit PWM generator with a compact configuration demux and simultaneously update mechanism.
PWM core
A 10-bit up-counter runs from 0 to reload_active.
On the clock where cnt = set_active, the output goes high.
On the clock where cnt = clr_active, the output goes low.
When cnt = reload_active, the counter wraps to 0.
Control truth table
Frequency and duty (plain text formulas):
PWM frequency = f_clk / (reload + 1)
High time (for set < clr) = (clr - set) / (reload + 1) of the period
If set > clr, the high window wraps around the end of the period.
Config demux + double buffering
Three shadow registers (set_shadow, clr_shadow, reload_shadow) are written via a single shared 10-bit bus:
Reset/enable
Internally, reset is gated with ena (res_ni_g <= rst_n and ena), so the design stays in reset while the tile isn’t enabled.
pin map (10-bit data path)
Note: reload must be ≥ 1. If reload = 0, the counter would stall (the RTL asserts a sim-time warning).
Bring the core out of reset
Program the three fields (example for ~9.77 kHz @ 10 MHz clk, 50% duty)
Write RELOAD
Write SET
Write CLEAR
Commit Simultaneously
Observe the output
Inputs type for different Requirements
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | data_i[0] (LSB) | pwm_o (active-high PWM) | sel[0] |
| 1 | data_i[1] | sel[1] | |
| 2 | data_i[2] | wr (strobe) | |
| 3 | data_i[3] | commit (strobe) | |
| 4 | data_i[4] | data_i[8] | |
| 5 | data_i[5] | data_i[9] (MSB) | |
| 6 | data_i[6] | ||
| 7 | data_i[7] |