Guidelines and workflow for writing, debugging, and reviewing synthesizable SystemC code compatible with Intel compilers.
Install
mkdir -p .claude/skills/systemc-tools && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10437" && unzip -o skill.zip -d .claude/skills/systemc-tools && rm skill.zipInstalls to .claude/skills/systemc-tools
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when writing, editing, reviewing, or debugging synthesizable SystemC code for Intel SystemC Compiler (ICSC) and SingleSource library. Covers rules for module hierarchy, channels and ports, process declarations, reset behavior, sensitivity lists, SystemC and C++ data types and collections. Applies communication channels, memory modules, data types and utility functions from Single Source library.Key capabilities
- →Implement synthesizable modules
- →Review SystemC code for synthesis risks
- →Debug reset logic
- →Manage module hierarchy
- →Apply SingleSource library utilities
How it works
It enforces synthesis constraints, module hierarchy rules, and process declaration patterns for the Intel SystemC Compiler.
Inputs & outputs
When to use systemc-tools
- →Implementing synthesizable hardware modules
- →Reviewing SystemC code for synthesis risks
- →Debugging reset logic in SystemC testbenches
About this skill
SystemC Tools
Use this skill for synthesizable SystemC code development and review in projects using ICSC and the SingleSource library. Apply it when implementing modules, records, channels, process code, assertions, or when reviewing existing code for synthesis, simulation, and SystemVerilog generation risks.
Workflow
- Identify the task type: implementation, refactor, debug, or review.
- Read the nearby code first: module ports, constructor bindings, process declarations, sensitivity lists, reset logic, channel usage, and tests.
- Check synthesis constraints before changing behavior: process kind, supported data types, control flow, function calls, dynamic allocation, and pointer usage.
- Prefer existing project patterns over introducing new abstractions.
- For edits, keep changes local to the relevant module, record, or helper.
- Validate with the narrowest relevant test or build target. For CMake projects, use the CMake Tools build/test tools.
- In reviews, lead with correctness, synthesis mismatch, reset/sensitivity, handshake, and missing-test risks.
Project Structure
- Expect a main source file such as
sc_main.cppcontaining the SystemC entry point and testbench/top instantiation. - A design normally has one translated top module, selected by
ELAB_TOPwhen required. - Keep design modules in headers/source files organized by protocol or block ownership.
- Keep testbench-only logic separate from synthesizable module logic.
- Avoid global or namespace variables for design state. Global and namespace constants are acceptable when they are compile-time constants.
Module Hierarchy
- A module is a C++ class or structure inheriting
sc_module. - A modular interface inherits both
sc_interfaceandsc_module; ICSC flattens it into the parent module in generated SystemVerilog. - A pure interface inherits
sc_interfaceonly and is not part of the module hierarchy. - Instantiate modules and modular interfaces inside parent modules, except top-level instances in
sc_mainor testbench hierarchy. - Do not pass modules, modular interfaces, or pointers to them as function parameters or return values.
- Do not use module or modular interface types as signal or port payload types.
Modules And Modular Interfaces
- Use explicit ports, signals, and SingleSource channels for interconnect.
- Avoid direct field access across normal module boundaries.
- Access child modular interface fields and methods only when they are flattened into the same generated module.
- Access modular interface methods through
sc_port<IF>or a parent-owned pointer only when the connected interface is valid for flattening. - Keep module ownership clear: one parent owns each child module/interface instance.
- Avoid multiple pointers to the same heap-allocated SystemC object.
Module Constructors
- Every module and modular interface needs a constructor with
sc_module_name, orSC_CTORwhen suitable. - Constructor bodies may create processes, bind ports/channels, allocate elaboration-time objects, and call elaboration-time helper functions.
- Prefer static/member object construction over dynamic allocation.
- If dynamic allocation is needed, use it only during elaboration. Use
newfor SystemC objects where supported, andsc_neworsc_new_arrayfor non-sc_objectdata. - Bind all child ports and channels in constructors. Unconnected child ports may be promoted to top-level ports.
- Initialize constants in-place, in constructor initializer lists, or in supported elaboration callbacks.
- Initialize non-constant runtime state in reset code, not as a substitute for reset behavior.
Process Code
- Use
SCT_METHODto create combinational method process. UseSCT_THREADmacro to create sequential thread process. UseSC_CTHREADmacro only in testbench and only if it required, for example for process without sensitivity. Never useSCT_CTHREADmacro. - Use method processes for combinational logic and simple sequential methods where project conventions allow.
- Use thread processes when multiple states or explicit
wait()calls simplify the design. - A combinational method must be sensitive to every signal, port, or channel it reads.
- A method must not read a signal or port that it writes in the same process.
- A thread reset section is the code before the first
wait(); reset modified channels and register variables there. - Avoid to have any code between reset section
wait()and the main loop. One exception is if multi-cycle initialization is required for an object like memory or complex data structure used in the process. - Keep the main thread loop simple. Prefer one
wait()at the end of the loop unless a real multi-state protocol is needed. - Assertions in thread processes should be before the main loop, not inside it, unless using a supported loop assertion form.
- Do not put unsupported function calls or side effects in process sensitivity, loop conditions, or complex conditions.
Data Types And Literals
- Prefer SystemC/SCT integer types over C++ integer types for hardware-width values.
- Use
boolfor one-bit Boolean intent and loop variables such asintorunsignedfor simple static loops. - Prefer
sct_uint<N>andsct_int<N>for bit-accurate widths, including optional zero-width fields. - Use
sc_biguint<N>andsc_bigint<N>when exact wide arithmetic behavior is more important than simulation speed. - Avoid unsupported types:
sc_lv,sc_logic,sc_signed,sc_unsigned, fixed-point types, and floating-point types in synthesizable code. - Do not mix signed and unsigned values in one expression unless explicitly cast and reviewed.
- Use string literals for numeric literals wider than 64 bits.
- Use
sct_zeros<N>andsct_ones<N>for all-zero and all-one SCT literals. - Remember that uninitialized local SystemC integer variables are zero-initialized by their constructors.
Channels And Ports
- Use
sct_signal,sct_in, andsct_outfor SingleSource signal and port interconnect when that is the project convention. - Use
sc_signal,sc_in, andsc_outwhere the surrounding code already uses standard SystemC ports/signals. - Connect sibling modules through parent-owned signals or through supported SingleSource channels.
- Bind ports through hierarchy only when ownership and direction remain clear.
- Ensure all ports are connected in design or testbench; otherwise expect top-port promotion.
- For target/initiator channels, bind endpoints in the common parent and connect clock/reset with
clk_nrst()where required. - Add every accessed SingleSource channel or signal/port to process sensitivity according to the process kind.
- Avoid combinational loops in FIFO/channel ready-valid paths.
Collections
- Built-in arrays and
std::arrayare supported for data and many SystemC objects, but follow local code style. - Prefer
sc_vectorfor arrays of signals, ports, modules, and modular interfaces when supported. - Keep pointer arrays homogeneous. Elements should be all
nullptror all allocated objects of the same concrete class. - Avoid non-rectangular pointer data structures except for supported module-array cases.
- Do not index a signal/port array or record array using the same array element when that pattern is unsupported.
- Do not pass
sc_vectorto or return it from functions.
Structures
- Use records for plain data payloads, not for modules, channels, signals, ports, or ownership.
- Records used in channels or ports should have a default constructor,
operator==,operator<<, andsc_tracewhen required by the channel/port type. - Keep records trivially copyable where they are passed by value or returned from functions.
- Records cannot contain pointers, references, modules, modular interfaces, signals, or ports in synthesizable payload code.
- Avoid nested records when ICSC restrictions apply.
- Record constructors may contain function calls, but field in-place initialization and initializer lists must not call functions.
Control Flow
- Conditions for
if,?:,for,while, anddo whilemust be side-effect free. ifand ternary conditions may call side-effect-free functions withoutwait().for,while, anddo whileconditions must not call functions.- Method
range()arguments forsct_uint,sct_intand other bit-accurate types in loop if loop counter is used as index should use of the following form:range(i+N, i)orrange(i, i-N)orrange(M*i + N, M*i)whereiis the loop counter,MandNare constants. The same is applicable foroperator ()forsct_uint,sct_intand other bit-accurate types which has the same semanthic asrange(). - Static loops without
wait()must have statically determinable iteration counts. - Loops with
wait()may have dynamic iteration counts, but every path must respect process wait/reset rules. switchcases need one finalbreak, or return-only cases in supported function patterns. Do not mixbreakandreturnstyles in one switch.- Avoid
breakandcontinuein main loops and loops containingwait(). - Do not use
goto.
Arithmetical Operations
- Operator comma (
operator ,) forsct_uint,sct_intand other bit-accurate types concatenates arguments therefore it requires correct order of arguments and their bit widths. - Preserve bit widths intentionally. Cast intermediate expressions when overflow or promotion could change generated SV behavior.
- Never mix signed and unsigned operands casually; this is a common SystemC versus SV mismatch source.
- Avoid bitwise
~on C++bool; use logical!. - Review
>>,/, and%carefully withsc_bigintorsc_biguint; use a single big variable operand where required. - Avoid left-shift overflow on C++ integer types.
- For protocol bit packing, keep struct member order, documented bit ranges,
toBits(), andfromBits()in exact agreement. - Prefer explicit width constants and typedefs for
Content truncated.
When not to use it
- →Non-synthesizable code development
Limitations
- →Requires adherence to synthesis subset
- →Requires manual test validation
How it compares
This provides a specialized, synthesis-aware development environment compared to generic SystemC coding.
Compared to similar skills
systemc-tools side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| systemc-tools (this skill) | 0 | 2mo | Review | Advanced |
| static-analysis | 5 | 6mo | No flags | Advanced |
| rr-debugger | 1 | 3mo | Review | Advanced |
| c-pro | 1 | 4mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
static-analysis
gmh5225
Expertise in LLVM-based static analysis including dataflow analysis, pointer analysis, taint tracking, and program verification. Use this skill when implementing security scanners, bug finders, code quality tools, or performing program analysis research.
rr-debugger
gadievron
Deterministic debugging with rr record-replay. Use when debugging crashes, ASAN faults, or when reverse execution is needed. Provides reverse-next, reverse-step, reverse-continue commands and crash trace extraction.
c-pro
sickn33
Write efficient C code with proper memory management, pointer arithmetic, and system calls. Handles embedded systems, kernel modules, and performance-critical code. Use PROACTIVELY for C optimization, memory issues, or system programming.
quality-checker
rdkcentral
Run comprehensive quality checks (static analysis, memory safety, thread safety, build verification) on the MemCapture codebase. Use when validating code changes or debugging before committing.
unreal-engine-cpp-pro
sickn33
Expert guide for Unreal Engine 5.x C++ development, covering UObject hygiene, performance patterns, and best practices.
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects