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:
- Its interface had become cumbersome and "hackish" when it was refactored to support the compiler emitting multiple modules.
- 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:
- 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.
- (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.
- 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.
- Ability to retrieve memory values, with some reasonable (configurable?) timeout if memory values can not be retrieved due to unavailable free read cycles.
- The equivalent of the "control state" inspectable feature - a compiler option that will automatically add "inspectables" for pipeline control state.
Optional Features
- 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.
- A mechanism to allow Kanagawa code to retrieve inspectables (self-inspection)
Out of Scope
- Any facility to expose Inspectables over PCIe or other I/O interface.
- Writing (Inspectables will remain read-only)
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:
Core Features
We would like to have a new version of inspectables. This version should support the following features:
Optional Features
Out of Scope