សិល្បៈ
សម្រស់ និង សុខុមាលភាព
សិប្បកម្ម
វប្បធម៌ និង ប្រវត្តិសាស្ត្រ
ការកម្សាន្ត
បរិស្ថាន
ម្ហូប និង ភេសជ្ជៈ
វិស្វកម្មបញ្ច្រាស
វិទ្យាសាស្ត្រ
កីឡា
បច្ចេកវិទ្យា
ប្រដាប់ដែលស្លៀក

Youblob (simulation output) · CC0
Your Own chip_core: An 8-bit PWM Dimmer, Tested Before It Is Silicon
The wafer.space project template arrives with an example design, a 42-bit counter, in src/chip_core.sv. Your own chip starts where you replace it, and a chip cannot be patched after the foundry has made it, so the replacement has to be proven in simulation first.
This rung replaces the counter with an 8-bit PWM dimmer. Eight pads read a brightness from 0 to 255, one pad drives the pulse-width-modulated output, and an input pin enables it. It uses the template's own port list, so it drops into the template unchanged, and it fits even the smallest 0.5x0.5 slot.
Both the core and its cocotb testbench were run for this blueprint with Icarus Verilog 12.0 and cocotb 2.1.0, and all three tests pass. The picture is that simulation's own output.
កម្រិតខ្ពស់
An evening
ការណែនាំ
1
1
What an 8-bit PWM gives you
What an 8-bit PWM gives you
កំពុងផ្ទុកសៀវភៅ Jupyter…
2
2
The template this core goes into
The template this core goes into
The embedded blueprint sets up the project template. This rung writes the core that goes inside it.
3
3
What chip_core is given
What chip_core is given
In the template, chip_top.sv holds the pad ring and passes the pads to chip_core, which receives the clock, an active-low reset and three groups of signals: input pads, bidirectional pads and analog pads. The numbers of each depend on the slot: the 0.5x0.5 slot has 4 input, 38 bidirectional and 4 analog pads, the full 1x1 slot 12 input, 40 bidirectional and 2 analog.
A bidirectional pad is controlled from inside the core, one bit per pad: bidir_oe enables the output driver, bidir_ie the input buffer, bidir_cs chooses a Schmitt-trigger input, bidir_sl a slow slew rate, and bidir_pu and bidir_pd switch in pull-up and pull-down resistors. The template's example drives every bidirectional pad as an output; this rung turns eight of them into inputs.
4
4
The core
The core
src/chip_core.sv for the dimmer. The port list is the template's, unchanged. Pads 0 to 7 are inputs with Schmitt triggers; pad 8 and above are outputs, with every pad except 8 held low. The template's example also instantiated two SRAM macros; this core does not use them, so they are gone.
chip_core.svsystemverilog
ឧបករណ៍ដែលត្រូវការ៖
កុំព្យូទ័រតុ5
5
The test that proves it
The test that proves it
A cocotb testbench that drives chip_core directly. It sets six duty values and counts the high clocks over four whole periods (1,024 clocks), checks that disabling the core holds the output low, and checks the pad directions. Run it with python3 test_pwm.py; Icarus Verilog needs -g2012 for the SystemVerilog and a 1 ns / 1 ps timescale for the 20 ns clock.
test_pwm.pypython
ឧបករណ៍ដែលត្រូវការ៖
កុំព្យូទ័រតុ6
6
What the simulation printed
What the simulation printed
The run for this blueprint, Icarus Verilog 12.0 and cocotb 2.1.0, parameters for the 0.5x0.5 slot:
duty 0: high 0 of 1024 cycles
duty 1: high 4 of 1024 cycles
duty 64: high 256 of 1024 cycles
duty 128: high 512 of 1024 cycles
duty 200: high 800 of 1024 cycles
duty 255: high 1020 of 1024 cycles
TESTS=3 PASS=3 FAIL=0 SKIP=0
Every count is exactly four times the duty value. To check that the test can fail, the comparison in the core was changed from count < duty to count <= duty; the test then failed at once (duty 0 gave 4 high cycles, not 0), and the core was put back.
In the template itself, replace src/chip_core.sv with this file and update the template's own testbench, cocotb/chip_top_tb.py, whose test still expects the counter; make sim then runs it through the pads and the PDK's models.
7
7
A core that will not simulate or will not pass
A core that will not simulate or will not pass
chip_core simulation troubleshooting.
Flow
Loading...
8
8
Sources and honest limits
Sources and honest limits
**Sources**, read 29 September 2026: the wafer-space/gf180mcu-project-template repository (src/chip_core.sv, src/slot_defines.svh, cocotb/chip_top_tb.py; Apache-2.0), whose port list and pad-control signals this core keeps.
**Honest limits.** The simulation is at the chip_core level only, without the pad ring, the PDK's pad and SRAM models, synthesis or a layout. It proves the logic, not the timing or the manufactured chip. The gate-level simulation after LibreLane, which the template runs with make sim-gl, is the next check.
ឧបករណ៍ចាំបាច់
1- កន្លែងទុក
ប្លង់ពាក់ព័ន្ធ
ប្លង់ទាំងនេះចែករំលែកចំណេះដឹង — បច្ចេកទេស សម្ភារៈ ឬគោលការណ៍
CC0 សាធារណៈ
ប្លង់នេះត្រូវបានចេញផ្សាយក្រោម CC0។ អ្នកមានសិទ្ធិចម្លង កែប្រែ ចែកចាយ និងប្រើប្រាស់ដោយមិនចាំបាច់សុំអនុញ្ញាត។
គាំទ្រអ្នកបង្កើតដោយទិញផលិតផលតាមរយៈប្លង់របស់ពួកគេ ដែលពួកគេទទួលបាន កម្រៃជើងសារអ្នកបង្កើត កំណត់ដោយអ្នកលក់ ឬបង្កើតកំណែថ្មីនៃប្លង់នេះ ហើយបញ្ចូលជាការតភ្ជាប់ក្នុងប្លង់របស់អ្នកដើម្បីចែករំលែកចំណូល។


