OpenCAN¶
OpenCAN is an open CAN network core for spacecraft on-board communication that implements ECSS-E-ST-50-15C (CANbus
extension protocol). It connects a node to a CAN network with a nominal and a redundant bus and provides the
redundancy management, the time distribution and the application layer services (CiA 301) of the standard. The CAN
protocol itself (frames, arbitration, error handling, fault confinement) comes from the CAN 2.0B controller
olo_intf_can of the Open Logic VHDL Library. The core is vendor-independent VHDL-2008; buffers use the
fault-tolerant entities of Open Logic (SECDED ECC).
Status¶
Technology readiness level: TRL 3 (fully verified by simulation) for phases a to c, the slave node of the
standard, and for the register interface of phase d: the data link on the nominal and the redundant bus
(ocan_link), the frame dispatcher (ocan_dispatch), the network management (ocan_nmt), the bus redundancy
management (ocan_redundancy), the time distribution (ocan_time), the object dictionary (ocan_od), the SDO server
(ocan_sdo), the PDOs (ocan_pdo), the top level ocan_core, the register interface ocan_mib and the top level
ocan_axi for a processor system, each with its specification, architecture, verification plan and verification
report. The 418 tests of the 19 testbenches pass in GHDL and in QuestaSim, with and without code coverage. They run
the node on both buses against a CAN network model written from the standards: the start-up on the default bus, the
bus monitoring and toggling of the redundancy management, the network management, SDO transfers and PDOs, the time
distribution at the SYNC, corrupted and missing frames, invalid NODE-ID codes and upsets injected through the ErrInj
ports. A reference model checks every register and every output of ocan_mib in every clock cycle, and ocan_axi
runs the node on the network through its registers. Code coverage is closed or every remaining miss is justified
(coverage). The compliance matrix assigns every clause of the standard to a
building block of the architecture or marks it out of scope, and traces every clause in scope to its requirements and
test cases. The core has not been tested on hardware and has no flight heritage; the hardware test on a redundant CAN
network (phase d) is the step to TRL 4. See what the levels mean and the steps to the
next level in the roadmap. The user guide describes the
integration and the conformance.
Documentation¶
| Document | Content |
|---|---|
| docs/user_guide.md | Integration of the core: generics, interfaces, protection scope, conformance |
| docs/architecture.md | Scope, architecture decisions, building blocks, traceability matrix |
| docs/compliance.md | ECSS compliance matrix (generated by tools/compliance.py) |
| docs/roadmap.md | Development phases and module status |
| docs/conventions.md | Coding, verification and repository conventions |
| docs/coverage.md | Code coverage: method, result and the justification of every remaining miss |
| CHANGELOG.md | Changes of every release |
The documents are also published as a website: openspacehdl.org/opencan (built
from this repository by tools/docs/).
Repository structure¶
opencan/
|-- docs/ Top-level documentation
|-- hdl/<module>/ One folder per module: src/, tb/, docs/ (ocan_mib also regs/, the register map)
|-- tb/ Verification components shared by the testbenches
|-- lint/ VSG configuration (Open Logic rules), synthesizability check
|-- tools/ Tools of the repository: compliance matrix, register map generator
| `-- docs/ Documentation website (MkDocs)
|-- sw/ C header of the register map (generated by tools/regmap.py)
|-- open-logic/ Git submodule: Open Logic (fault-tolerant entities branch)
|-- uvvm/ Git submodule: UVVM verification framework
|-- component_list.txt Modules in dependency order
|-- compile_order.txt Synthesis sources in compile order (generated by run.py)
`-- run.py VUnit regression runner
Running the tests¶
Prerequisites: Python 3, GHDL on the PATH and the Python packages of
requirements.txt.
git submodule update --init
python -m pip install -r requirements.txt
python run.py -p 8 # full regression with GHDL, 8 parallel simulations
python run.py "*ocan_<module>*" # one module
python run.py --questa <test> # QuestaSim
run.py compiles Open Logic into the VHDL library olo, the required UVVM components into their own libraries and
all OpenCAN sources into the library opencan. OCAN_GHDL_SIM_FLAGS passes extra flags to the GHDL simulation, for
example --vcd=wave.vcd for a waveform.
Checks besides the regression:
python lint/lint.py # VSG, no errors and no warnings
python run.py --compile-order # compile_order.txt; the CI fails when the file changes
python tools/regmap.py --check # register map outputs of hdl/ocan_mib/regs/ocan_regs.yml up to date
python tools/compliance.py --check # compliance matrix up to date and complete
python -m mkdocs build -f tools/docs/mkdocs.yml # documentation website, fails on broken links
Trademarks¶
CiA® and CANopen® are registered trademarks of CAN in Automation e.V. OpenCAN implements ECSS-E-ST-50-15C; its conformance statement refers to that standard. The core has not been tested or certified by CAN in Automation.
Licence¶
OpenCAN is licensed under the PSI HDL Library License, Version 1.0, the licence of Open Logic (LGPL 2.1 with an exception for binaries, see LGPL2_1.txt).