circt/test/CAPI/CMakeLists.txt

16 lines
248 B
CMake
Raw Normal View History

add_llvm_executable(circt-capi-ir-test
ir.c
[PyCDE,CAPI] Add support for the FSM dialect (#3400) This is an initial commit for adding a CAPI for FSM as well as PyCDE support for constructing these. See `test_fsm.py` for usage. FSMs are constructed in a similar manner to PyCDE modules through a decorator on a class describing the FSM. The FSM class may contain inputs (no outputs for now) and must provide - A dictionary containing the states and their transitions - A default state State transitions may be either always taken, or taken based on some guard. This guard is defined by a function provided to the transition, which (like `@generator` functions) acts on the ports of the FSM. The FSM will then be constructed with an output for each state, asserted when that state is active. One important implementation note is the fact that the `fsm.machine` operation is treated as a PyCDE Module - there was surprisingly little friction slotting it into the current code and everything works as expected wrt. referencing `fsm.machine` in/out arguments through the transition guard functions. However, modules instantiating the FSM expect a hardware-like interface, this being the ports of the `fsm.machine` operation + clock and reset signals. An `fsm.machine` op does not have these signals at the top level, since these are added during hardware lowering. To me, this is a sensible design choice, seeing that the FSM dialect should be applicable to both software and hardware representations (...eventually). To get around this, the user will specify the intended name of the `clock` and optional `reset` signal of an FSM. A wrapper module is then created that provides the correct interface to the instantiating module, as well as instantiating the FSM through a `fsm.hw_instance` operation, doing the proper hoop-jumping to attach the clock signal (see `fsm_wrapper_class`). There's still some work to do on the CIRCT side of the FSM dialect to clean it up a bit + make it a viable target for a front-end, but this commit represents the brunt of work on the PyCDE side.
2022-06-27 22:14:38 +08:00
)
llvm_update_compile_flags(circt-capi-ir-test)
target_link_libraries(circt-capi-ir-test
PRIVATE
2021-03-03 01:38:29 +08:00
CIRCTCAPIComb
CIRCTCAPIHW
CIRCTCAPISeq
CIRCTCAPISV
[PyCDE,CAPI] Add support for the FSM dialect (#3400) This is an initial commit for adding a CAPI for FSM as well as PyCDE support for constructing these. See `test_fsm.py` for usage. FSMs are constructed in a similar manner to PyCDE modules through a decorator on a class describing the FSM. The FSM class may contain inputs (no outputs for now) and must provide - A dictionary containing the states and their transitions - A default state State transitions may be either always taken, or taken based on some guard. This guard is defined by a function provided to the transition, which (like `@generator` functions) acts on the ports of the FSM. The FSM will then be constructed with an output for each state, asserted when that state is active. One important implementation note is the fact that the `fsm.machine` operation is treated as a PyCDE Module - there was surprisingly little friction slotting it into the current code and everything works as expected wrt. referencing `fsm.machine` in/out arguments through the transition guard functions. However, modules instantiating the FSM expect a hardware-like interface, this being the ports of the `fsm.machine` operation + clock and reset signals. An `fsm.machine` op does not have these signals at the top level, since these are added during hardware lowering. To me, this is a sensible design choice, seeing that the FSM dialect should be applicable to both software and hardware representations (...eventually). To get around this, the user will specify the intended name of the `clock` and optional `reset` signal of an FSM. A wrapper module is then created that provides the correct interface to the instantiating module, as well as instantiating the FSM through a `fsm.hw_instance` operation, doing the proper hoop-jumping to attach the clock signal (see `fsm_wrapper_class`). There's still some work to do on the CIRCT side of the FSM dialect to clean it up a bit + make it a viable target for a front-end, but this commit represents the brunt of work on the PyCDE side.
2022-06-27 22:14:38 +08:00
CIRCTCAPIFSM
CIRCTCAPIExportVerilog
[PyCDE,CAPI] Add support for the FSM dialect (#3400) This is an initial commit for adding a CAPI for FSM as well as PyCDE support for constructing these. See `test_fsm.py` for usage. FSMs are constructed in a similar manner to PyCDE modules through a decorator on a class describing the FSM. The FSM class may contain inputs (no outputs for now) and must provide - A dictionary containing the states and their transitions - A default state State transitions may be either always taken, or taken based on some guard. This guard is defined by a function provided to the transition, which (like `@generator` functions) acts on the ports of the FSM. The FSM will then be constructed with an output for each state, asserted when that state is active. One important implementation note is the fact that the `fsm.machine` operation is treated as a PyCDE Module - there was surprisingly little friction slotting it into the current code and everything works as expected wrt. referencing `fsm.machine` in/out arguments through the transition guard functions. However, modules instantiating the FSM expect a hardware-like interface, this being the ports of the `fsm.machine` operation + clock and reset signals. An `fsm.machine` op does not have these signals at the top level, since these are added during hardware lowering. To me, this is a sensible design choice, seeing that the FSM dialect should be applicable to both software and hardware representations (...eventually). To get around this, the user will specify the intended name of the `clock` and optional `reset` signal of an FSM. A wrapper module is then created that provides the correct interface to the instantiating module, as well as instantiating the FSM through a `fsm.hw_instance` operation, doing the proper hoop-jumping to attach the clock signal (see `fsm_wrapper_class`). There's still some work to do on the CIRCT side of the FSM dialect to clean it up a bit + make it a viable target for a front-end, but this commit represents the brunt of work on the PyCDE side.
2022-06-27 22:14:38 +08:00
)