Skip to content

Inspectables V2 #102

@matthew-humphrey

Description

@matthew-humphrey

Background

Prior to open sourcing the project, the Kanagawa compiler supported a feature called "Inspectables". With this feature the user would decorate static variables or memories in their Kanagawa code with an attribute and a name. The compiler would then insert logic to introspect this variable/memory at runtime. The "inspectables" were connected together in daisy-chain fashion, and an interface on the generated top-level module would provide a way to retrieve these values individually.

This feature was removed before OSS for a couple of reasons:

  1. Its interface had become cumbersome and "hackish" when it was refactored to support the compiler emitting multiple modules.
  2. It's original design was to be used over a high latency, single-threaded interface (non-pipelined PCIe MMIO), and therefore the underlying inspectables protocol was not conducive to retrieving the values in a pipelined fashion. In addition, because memory inspectables worked by stealing unused cycles, it was possible for a memory to block retrieval.

Core Features

We would like to have a new version of inspectables. This version should support the following features:

  1. Allow the inspectables interface for multiple Kanagawa compiler-generated modules to be daisy-chained together, and for the controller retrieving inspectables to be able to determine the identity of each module on this chain and how many inspectables it contains.
  2. (Needed for number 1 above) Some concept of an identifier for a module on an inspectables chain. Ideally we would also support a version, but at a minimum a hash value should also be provided. Note that identifier and version will need to be provided by the user in the source code.
  3. Ability to do an efficient pipelined retrieval of NON-MEMORY inspectables. With this an external controller (which is outside of the scope of inspectables) would send a command telling Kanagawa generated modules to start sending their inspectables. By skipping memories, there are no issues with stalls (or deadlocks) due to free memory read cycles not being available.
  4. Ability to retrieve memory values, with some reasonable (configurable?) timeout if memory values can not be retrieved due to unavailable free read cycles.
  5. The equivalent of the "control state" inspectable feature - a compiler option that will automatically add "inspectables" for pipeline control state.

Optional Features

  1. One of the challenges with the old inspectables is that the metadata for them was not baked in the hardware and was contained in a file generated by the compiler. It would be nice if there was an option to have the compiler include some reasonable, baseline metatadata in the hardware, and a mechanism to retrieve that.
  2. A mechanism to allow Kanagawa code to retrieve inspectables (self-inspection)

Out of Scope

  1. Any facility to expose Inspectables over PCIe or other I/O interface.
  2. Writing (Inspectables will remain read-only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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