Skip to content

--clock-hz is not propagated as a Vivado timing constraint #98

@JOOpdenhoevel

Description

@JOOpdenhoevel

Summary

The slashkit link command exposes a --clock-hz argument that is documented as the "Target clock frequency in MHz" (the help string is also misleading — the value is actually interpreted in Hz, see linker/slashkit/command_config.py:196-197). However, the value is only used as metadata that ends up in system_map.xml. It is not forwarded to Vivado as a timing constraint. As a consequence, Vivado always places and routes the user region against the hard-coded 400 MHz that is baked into the static shell, and then reports whatever it could close timing at — regardless of what the user requested.

Expected behavior

When the user passes --clock-hz <freq>:

  • The requested frequency should be turned into a real Vivado constraint on the user-region clock (e.g. by overriding CONFIG.FREQ_HZ on the relevant shell ports, by emitting a create_clock / set_clock_groups constraint in the user region, or by parameterising the static-shell clocking IP).
  • Vivado should target exactly that frequency, so that:
    • place-and-route can terminate early once the target is met instead of always optimising toward 400 MHz;
    • the value written to system_map.xml actually matches the constraint that PnR was run against.

Actual behavior

--clock-hz only flows through resolve_system_map_clock into the rendered system_map.xml. The clock that Vivado actually sees is always 400 MHz, fixed by the static shell template.

Pointers to the relevant code

Suggested fix direction

Thread config.clock_hz (with a sensible default such as the existing DEFAULT_CLOCK_HZ = 200_000_000 from linker/slashkit/emit/metadata/system_map_ctx.py:32) into the hardware Tcl generation so that:

  1. The CONFIG.FREQ_HZ properties in slash_base.tcl / the user-region wrapper are templated rather than hard-coded 400000000, or
  2. A create_clock -period constraint is emitted into the user-region XDC at link time.

Either way, the value should be the single source of truth that is also written into system_map.xml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions