...
 
Commits (2554)
# Ignore Modelsim generated files
*.bak
/modelsim_project/work
*__pycache__*
*.swp
*.orig
*~
.fuse_hidden*
.mypy_cache
debian/ctucanfd-drv
debian/*.log
debian/*.substvars
debian/debhelper-build-stamp
debian/*.debhelper
debian/files
image: registry.gitlab.com/canfd/server-tools/ghdl
before_script:
- "export PATH=/opt/ghdl/bin:$PATH"
- export LC_ALL=C.UTF-8
- export LANG=C.UTF-8
- export PYTHONUNBUFFERED=1
stages:
- precheck
- build
- test
- deploy
check_component:
stage: precheck
script:
- scripts/gen_vivado_component.py
- cd scripts && ./update_reg_map
- git diff --exit-code || (echo "Vivado component file or register map products are not up-to-date. Either run scripts/gen_vivado_component.py and scripts/update_reg_map or download the files from this job's artifacts."; exit 1)
artifacts:
expire_in: 1 week
paths:
- src/component.xml
- doc/core/registerMap.lyx
- driver/ctu_can_fd_regs.h
- src/lib/can_fd_register_map.vhd
build_ip_and_tests:
stage: build
artifacts:
paths: &vunit_build_paths
- test/build
expire_in: 5 hrs
script:
- cd test
- make elaborate
# Do not include the huge binaries in artifacts.
- rm -R build/vunit_out/test_output
only: &only
- master # Run on all changes to master branch
- tags # Run on all tags
- triggers # Run by trigger (on merge request)
- web # Run by manual request from web UI
build_driver:
stage: build
only: *only
script:
- cd driver
- "make -j`nproc`"
build_doc:
stage: build
only: *only
image: registry.gitlab.com/canfd/server-tools/lyx
script:
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
- make -C doc/core
- make -C doc/driver
artifacts:
paths:
- doc/core/Progdokum.pdf
- doc/core/ctu_can_fd_architecture.pdf
- doc/driver/build
build_linux_driver:
stage: build
only: *only
image: registry.gitlab.com/canfd/server-tools/ctucanfd_drvtest
script:
- cd driver/linux
- "make -j`nproc` KDIR=/linux/build"
- "make checkpatch KDIR=/linux/build"
artifacts:
paths:
- driver/linux/ctucanfd.ko
test_ip_fast:
stage: test
only: *only
dependencies: [build_ip_and_tests]
script:
- cd test
- make test_fast
artifacts:
when: always
paths:
- test/tests_fast.xml
- test/xunit.xsl
reports:
junit: [test/tests_fast.xml]
test_ip_nightly:
stage: test
dependencies: [build_ip_and_tests]
only:
- schedules
script:
- cd test
- make test_nightly
after_script:
- cd test
- make coverage
- make functional_coverage
- cd ../scripts
- chmod +x gen_vrm
- ./gen_vrm
coverage: "/lines......: ([^%]+%)/"
artifacts:
when: always
paths:
- test/code_html
- test/tests_nightly.xml
- test/xunit.xsl
- test/build/functional_coverage
- scripts/VRM.html
reports:
junit: [test/tests_nightly.xml]
# Nightly tests might fail due to randomization. It is not preffered to
# kill whole follow-up coverage processing due to this failure!
# Fast pipeline on the other hand can't fail because it must pass before merge!
allow_failure: true
pages:
stage: deploy
when: always
#dependencies: [test_ip_unit, test_ip_sanity]
script:
- mkdir -p public
- cp test/xunit.xsl public/
- cp test/tests_*.xml public/
- mv test/code_html public/coverage || true
- cp doc/core/Progdokum.pdf public/ || true
- cp doc/core/ctu_can_fd_architecture.pdf public/ || true
- cp -R doc/driver/build public/driver_doc || true
- mkdir public/functional_coverage
- cp -R test/build/functional_coverage/* public/functional_coverage || true
- cp scripts/VRM.html public/ || true
only:
- master
artifacts:
paths:
- public
variables:
GIT_SUBMODULE_STRATEGY: recursive
[submodule "pyXact_generator"]
path = scripts/pyXact_generator
url = https://github.com/Blebowski/Reg_Map_Gen
<?xml version="1.0" encoding="UTF-8"?>
<com.sigasi.hdt.shared.librarymapping.model:LibraryMappings xmlns:com.sigasi.hdt.shared.librarymapping.model="com.sigasi.hdt.vhdl.scoping.librarymapping" Version="2">
<Mappings Location="Common Libraries/IEEE" Library="ieee"/>
<Mappings Location="Common Libraries/IEEE Synopsys" Library="ieee"/>
<Mappings Location="Common Libraries" Library="not mapped"/>
<Mappings Location="Common Libraries/STD" Library="std"/>
<Mappings Location="" Library="work"/>
</com.sigasi.hdt.shared.librarymapping.model:LibraryMappings>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ctu_can_fd_2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.sigasi.hdt.vhdl.ui.vhdlNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
<linkedResources>
<link>
<name>Common Libraries</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>Common Libraries/DRAG_REUSABLE_LIBRARIES_HERE.txt</name>
<type>1</type>
<locationURI>sigasiresource:/vhdl/readme.txt</locationURI>
</link>
<link>
<name>Common Libraries/IEEE</name>
<type>2</type>
<locationURI>sigasiresource:/vhdl/2008/IEEE</locationURI>
</link>
<link>
<name>Common Libraries/IEEE Synopsys</name>
<type>2</type>
<locationURI>sigasiresource:/vhdl/2008/IEEE%20Synopsys</locationURI>
</link>
<link>
<name>Common Libraries/STD</name>
<type>2</type>
<locationURI>sigasiresource:/vhdl/2008/STD</locationURI>
</link>
</linkedResources>
</projectDescription>
eclipse.preferences.version=1
encoding//Common\ Libraries/IEEE=utf-8
encoding//Common\ Libraries/IEEE\ Synopsys=utf-8
encoding//Common\ Libraries/STD=utf-8
encoding/Common\ Libraries=utf-8
CTU CAN FD IP Core
Copyright (C) 2015-2018
Authors:
Ondrej Ille <ondrej.ille@gmail.com>
Martin Jerabek <martin.jerabek01@gmail.com>
Project advisors:
Jiri Novak <jnovak@fel.cvut.cz>
Pavel Pisa <pisa@cmp.felk.cvut.cz>
Department of Measurement (http://meas.fel.cvut.cz/)
Faculty of Electrical Engineering (http://www.fel.cvut.cz)
Czech Technical University (http://www.cvut.cz/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this VHDL component and associated documentation files (the "Component"),
to deal in the Component without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Component, and to permit persons to whom the
Component is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Component.
THE COMPONENT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE COMPONENT OR THE USE OR OTHER DEALINGS
IN THE COMPONENT.
The CAN protocol is developed by Robert Bosch GmbH and protected by patents.
Anybody who wants to implement this IP core on silicon has to obtain a CAN
protocol license from Bosch.
# CTU CAN FD IP Core
CAN FD IP Core written in VHDL. Designed to be compliant with ISO1198-1:2015.
Supports ISO and NON-ISO versions of CAN FD protocol.
## License
CTU CAN FD is published under MIT license shown in:
[![License](https://img.shields.io/badge/License--black.svg)]( https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core/blob/master/LICENSE)
CTU CAN FD linux driver is published under GPLv2 license.
The CAN protocol is developed by Robert Bosch GmbH and protected by patents.
Anybody who wants to implement this IP core on silicon or FPGA for commercial
purposes has to obtain CAN protocol license from Bosch.
## Design
CTU CAN FD RTL is written in VHDL with no vendor specific libraries/components required.
CTU CAN FD is fully synchronous design. CTU CAN FD is written with frequent usage of clock enables to allow inferred clock gating on ASIC.
Architecture of CTU CAN FD is described in:
[![System architecture](https://img.shields.io/badge/System_architecture--blue.svg)]( http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/ctu_can_fd_architecture.pdf)
Functional description of CTU CAN FD is in datasheet:
[![Datasheet](https://img.shields.io/badge/Datasheet--blue.svg)]( http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/Progdokum.pdf)
## Dependencies
To simulate CTU CAN FD following dependencies are needed:
GHDL, VHDL simulator with custom changes:
[GHDL](https://github.com/Blebowski/ghdl).
GTKWave, Waveform viewer:
[GTKWave](http://gtkwave.sourceforge.net/)
Vunit, VHDL unit test framework, with modifications allowing to start GTKWave interactively when simulation run starts:
[Vunit](https://github.com/mjerabek/vunit).
Python 3 and following modules: pyvcd attrs jinja2 parsy pyyaml click yattag json2html
For simulation environment, there is a docker image available at:
[Simulation docker](https://gitlab.com/canfd/server-tools/container_registry).
## Verification
CTU CAN FD verification is done in GHDL + VUnit + GTKWave combination. Verification is done
on RTL (no gate level sims so far...).
There are following types of tests:
- Unit tests - Verify functionality of some modules stand-alone. Testbench for each module.
- Feature tests - Verify features of CTU CAN FD. Common testbench for many test-cases
- Sanity test - Real bus simulation (with delays, transceiver, noise). One testbench, different configurations.
- Reference test - Verify reception from reference CAN controller. One testbench, different file sets.
Test architecture is further described in:
TODO.
Each test/testbench has common header which is used to collect what has been verified (call it VRM if you want...):
[![Verification items](https://img.shields.io/badge/Verification_Items--yellow.svg)](http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/VRM.html)
There is PSL functional coverage and PSL assertions available in:
[![functional coverage](https://img.shields.io/badge/functional%20coverage--orange.svg)](http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/functional_coverage/functional_coverage_report.html)
For now GCov is used to collect code coverage in GHDL and its results are shown in:
[![coverage report](https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core/badges/master/coverage.svg)](http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/coverage/)
All tests are automated into two runs:
- Fast - no randomization (seed=0), must pass before merge request is merged.
- Nightly - randomized, runs every night. Should be debugged before release.
Results of latest test run + logs are available under:
[![pipeline status](https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core/badges/master/pipeline.svg)](http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/tests_fast.xml)
At the moment, CTU CAN FD compliance towards ISO1198-1:2015 has not been proven.
It is intended for future to build testbench with test sequences described in ISO16845-1:2016.
## Synthesis
CTU CAN FD has been synthesized into Xilinx and Intel FPGAs. BRAMs were inferred for
TX and RX buffers. CTU CAN FD reached about 100 MHz of maximal frequency. Synthesis
results are shown in:
TODO.
## Linux driver
CTU CAN FD has SocketCAN Linux driver which is described in:
[![Linux driver](https://img.shields.io/badge/Linux_driver--blue.svg)](http://canbus.pages.fel.cvut.cz/ctucanfd_ip_core/driver_doc/ctucanfd-driver.html)
There are three driver parts:
- Network
- Platform
- PCI
Driver has been tested on two boards:
- [![PCI board](https://img.shields.io/badge/PCI_board--blue.svg)](https://gitlab.fel.cvut.cz/canbus/pcie-ctu_can_fd)
- [![Xilinx Zynq board](https://img.shields.io/badge/Zynq_board--blue.svg)](https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top) (Used for automated tests)
Operation up to 5 Mbits was tested (depending on physical layer transceiver type).
## Linux driver tests
Linux driver was debugged and tested manually against Kvaser devices, CANoe and other CAN FD controllers. Regular communication
and handling of Error states were debugged manually. There is an automated emulator at CTU FEE pulling latest CTU CAN FD
RTL, synthesizing into Xilinx Zynq FPGA, running PetaLinux, loading SocketCAN driver and running CAN/CAN FD communication (500 Kbit/s Nominal bit rate, 4 Mbit Data bit rate) with randomly generated frames between CTU CAN FDs and FD tolerant SJA1000. Results can be found at:
[![FPGA Emulator tests](https://img.shields.io/badge/FPGA_Emulator_Tests--cyan.svg)](https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top/pipelines)
However, there are no written tests for the driver itself (apart from compiling it without error and passing Linux kernels checkpatch which is required for pipeline to pass). In future QEMU + VPCIE + GHDL cosimulation is planned.
## RTL release package
CTU CAN FD RTL is postprocessed via script which removes PSL assertions and some signals intended only for verification purposes. This is done to save simulation time in systems where CTU CAN FD is integrated (there are hundreds of PSL cover points and PSL assertions). RTL release package from latest sources is available in:
TODO
ctucanfd-drv (1.0.0) unstable; urgency=medium
* Initial dkms build.
-- Pavel Pisa <ppisa@pikron.com> Fri, 18 Jan 2019 19:09:04 +0100
Source: ctucanfd-drv
Maintainer: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Section: admin
Priority: optional
Build-Depends: debhelper (>=9),
dkms
Standards-Version: 1.0.0
Vcs-Browser: https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core
Vcs-Git: https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core.git
Homepage: https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core
Package: ctucanfd-drv
Architecture: all
Depends: ${misc:Depends}
Description: CTU CAN FD IP Core driver
CAN with Flexible Data-rate IP Core developed
at Department of Measurement of FEE CTU.
.
This package provides driver for the core.
It supports PCI express cards as well as it provides
platform driver for SoC integration when appropriate
device tree is provided.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ctucanfd_ip_core
Source: https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core
Files: /driver/*
Copyright: 2018-2019 Ondrej Ille <ondrej.ille@gmail.com>
2018-2019 Martin Jerabek <martin.jerabek01@gmail.com>
2018-2019 Pavel Pisa <pisa@cmp.felk.cvut.cz>
License: GPL-2.0+
Files: /src/*
Copyright: 2018-2019 Ondrej Ille <ondrej.ille@gmail.com>
2018-2019 Martin Jerabek <martin.jerabek01@gmail.com>
License: CTUCANFD-Core License
License: CTUCANFD-Core License
CTU CAN FD IP Core
Copyright (C) 2015-2018
.
Authors:
Ondrej Ille <ondrej.ille@gmail.com>
Martin Jerabek <martin.jerabek01@gmail.com>
.
Project advisors:
Jiri Novak <jnovak@fel.cvut.cz>
Pavel Pisa <pisa@cmp.felk.cvut.cz>
.
Department of Measurement (http://meas.fel.cvut.cz/)
Faculty of Electrical Engineering (http://www.fel.cvut.cz)
Czech Technical University (http://www.cvut.cz/)
.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this VHDL component and associated documentation files (the "Component"),
to deal in the Component without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Component, and to permit persons to whom the
Component is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Component.
.
THE COMPONENT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE COMPONENT OR THE USE OR OTHER DEALINGS
IN THE COMPONENT.
.
The CAN protocol is developed by Robert Bosch GmbH and protected by patents.
Anybody who wants to implement this IP core on silicon has to obtain a CAN
protocol license from Bosch.
License: GPL-2.0+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General Public License
Version 2 can be found in `/usr/share/common-licenses/GPL-2'.
#!/bin/sh
for fname in ctu_can_fd.c ctu_can_fd_pci.c ctu_can_fd_platform.c ctu_can_fd.h \
ctu_can_fd_frame.h ctu_can_fd_hw.c ctu_can_fd_hw.h ctu_can_fd_regs.h
do
echo driver/${fname} /usr/src/${PACKAGE_NAME}-${PACKAGE_VERSION}
done
for fname in Kbuild Makefile ; do
echo driver/linux/${fname} /usr/src/${PACKAGE_NAME}-${PACKAGE_VERSION}
done
driver/dkms.conf
README.md
#!/usr/bin/make -f
export DH_VERBOSE = 1
export OMIT_KERNEL_PASSES = y
PACKAGE_NAME=$(shell grep PACKAGE_NAME= driver/dkms.conf | cut -d= -f2 | cut -d\" -f2)
PACKAGE_VERSION=$(shell grep PACKAGE_VERSION= driver/dkms.conf | cut -d= -f2 | cut -d\" -f2)
export PACKAGE_NAME PACKAGE_VERSION
%:
dh $@ --with dkms
# Nothing to configure, build or auto-install (this all happens after
# installation using dkms)
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_install:
/Progdokum.pdf
/version.tex
*.aux
*.log
*.out
*.toc
/pics
This diff is collapsed.
all: Progdokum.pdf ctu_can_fd_architecture.pdf
Progdokum.pdf: version.tex
#lyx --export-to pdf Progdokum.pdf Progdokum.lyx
lyx --export-to latex Progdokum.tex Progdokum.lyx
sed -rie '/\{inputenc\}/d' Progdokum.tex
iconv -f latin2 -t utf8 <Progdokum.tex >Progdokum.tex-1 && mv Progdokum.tex-1 Progdokum.tex
xelatex Progdokum
# run again to generate PDF outline and references
xelatex Progdokum
xelatex Progdokum
ctu_can_fd_architecture.pdf: version.tex
lyx --export-to latex ctu_can_fd_architecture.tex ctu_can_fd_architecture.lyx
sed -rie '/\{inputenc\}/d' ctu_can_fd_architecture.tex
iconv -f latin2 -t utf8 <ctu_can_fd_architecture.tex >ctu_can_fd_architecture.tex-1 && mv ctu_can_fd_architecture.tex-1 ctu_can_fd_architecture.tex
xelatex ctu_can_fd_architecture
# run again to generate PDF outline and references
xelatex ctu_can_fd_architecture
xelatex ctu_can_fd_architecture
version.tex: FORCE
desc=$$(git describe --always); \
date="$$(git show -s --format=%cd --date=format:%Y-%m-%d)"; \
echo "Datasheet $$desc, $$date" >$@
clean:
-rm -f *.aux *.toc *.out *.log Progdokum.tex CANFrameFormat.tex registerMap.tex
FORCE:
.PHONY: all clean
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SPHINXBUILD = sphinx-build
SPHINXOPTS =
SPHINXDIRS = .
SPHINX_CONF = conf.py
PAPER =
PDFLATEX = xelatex
LATEXOPTS = -interaction=batchmode
all: default
.PHONY: default
default:
sphinx-build -b html . build
This diff is collapsed.
This diff is collapsed.
.. ctucanfd documentation master file, created by
sphinx-quickstart on Mon Sep 9 14:45:43 2019.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to ctucanfd's documentation!
====================================
.. toctree::
:maxdepth: 2
:caption: Contents:
ctucanfd-driver
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
This diff is collapsed.
This diff is collapsed.