Skip to content

Commit

Permalink
Merge pull request #2 from timrulebosch/simbus
Browse files Browse the repository at this point in the history
Add signal schemas.
  • Loading branch information
TGoeppel authored Sep 7, 2021
2 parents 4eca694 + 1e37116 commit 089489a
Show file tree
Hide file tree
Showing 15 changed files with 658 additions and 131 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@

## Introduction
This is a collection of schemas in the Google FlatBuffers IDL for describing automotive network communications within a virtualized simulation environment.
Currently buffer representations of CAN, FlexRay, Ethernet and Encoded Signals at the level of a Communication Matrix definition are provided.

Currently buffer representations of CAN, FlexRay, Ethernet and Encoded Signals at the level of a Communication Matrix definition are provided.


## Project structure
```
L- docs Documentation
L- schemas Schemas of the Standard
L- docker Supporting build environments
```

Expand Down
31 changes: 0 additions & 31 deletions doc/network_model_flexray.md

This file was deleted.

37 changes: 19 additions & 18 deletions doc/network_model_can.md → doc/register/can.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@
-->


## Network Model CAN
# Automotive Bus Register Interface CAN

Model | Network Model CAN
## Overview

Schema | Register Interface CAN
:---|:---
  | [Schema File](../schemas/network_model_can.fbs)
MIME Type | application/x-open-simulation-interface-network-model; type=CAN;
  | [Schema File](../../schemas/register/can.fbs)
MIME Type | application/x-automotive-bus; interface=register; type=CAN;
Data Stream | 4 byte Message Length followed by FlatBuffers Message. Repeating.
FlatBuffers File Identifier | NMCA
Abbreviations | NM CAN, NMC, NMCA
FlatBuffers File Identifier | RICA

### Modeled BUS Features

## Modeled BUS Features

#### Tx/Rx FIFO(Buffer) Operation
### Tx/Rx FIFO(Buffer) Operation

The size and configuration of FIFO/Buffer is set when connecting to a Virtual BUS. Typically this is a limited resource and FIFO/Buffers are assigned to one of the Tx/Rx functions.


##### TX FIFO with Priority
#### TX FIFO with Priority

* TX Queue with maximum size.
* Messages are sent according to Message ID.
Expand All @@ -36,7 +37,7 @@ The size and configuration of FIFO/Buffer is set when connecting to a Virtual BU
- number of unused FIFO/Buffers


##### TX FIFO
#### TX FIFO

* TX Queue with maximum size.
* Messages are sent in order of enqueue (i.e. circular buffer).
Expand All @@ -50,7 +51,7 @@ The size and configuration of FIFO/Buffer is set when connecting to a Virtual BU
- number of unused FIFO/Buffers


##### RX FIFO
#### RX FIFO

* RX Queue with maximum size.
* Queue is cleared when ECU requests BUS Pull. ECU must handle all messages.
Expand All @@ -63,22 +64,22 @@ The size and configuration of FIFO/Buffer is set when connecting to a Virtual BU



#### TEC
### TEC


#### REC
### REC


#### Active Error Frame
### Active Error Frame


#### Passive Error Frame
### Passive Error Frame


#### Overload
### Overload


#### Frame Request
### Frame Request


#### L2 Status
### L2 Status
16 changes: 8 additions & 8 deletions doc/network_model_ethernet.md → doc/register/ethernet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
SPDX-License-Identifier: Apache-2.0
-->

# Automotive Bus Register Interface Ethernet

## Network Model Ethernet
## Overview

Model | Network Model Ethernet
Schema | Register Interface Ethernet
:---|:---
  | [Schema File](../schemas/network_model_ethernet.fbs)
MIME Type | application/x-open-simulation-interface-network-model; type=Ethernet;
  | [Schema File](../../schemas/register/ethernet.fbs)
MIME Type | application/x-automotive-bus; interface=register; type=Ethernet;
Data Stream | 4 byte Message Length followed by FlatBuffers Message. Repeating.
FlatBuffers File Identifier | NMEN
Abbreviations | NM Ethernet, NMEN
FlatBuffers File Identifier | RIEN


### Modeled BUS Features
## Modeled BUS Features

#### Ethernet Frame
### Ethernet Frame

Ethernet Frame | 68 - 1522 bytes
--|--
Expand Down
32 changes: 32 additions & 0 deletions doc/register/flexray.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!---
Copyright (c) 2021 for information on the respective copyright owner
see the NOTICE file and/or the repository https://github.com/boschglobal/automotive-bus-schema
SPDX-License-Identifier: Apache-2.0
-->


# Automotive Bus Register Interface FlexRay

## Overview

Schema | Register Interface FlexRay
:---|:---
&ensp; | [Schema File](../../schemas/register/flexray.fbs)
MIME Type | application/x-automotive-bus; interface=register; type=FlexRay;
Data Stream | 4 byte Message Length followed by FlatBuffers Message. Repeating.
FlatBuffers File Identifier | RIFR


## Modeled BUS Features

### Static/Dynamic Parts


### Slot Chasing (Events)


### FlexRay Startup


### L2 Status
111 changes: 111 additions & 0 deletions docker/flatc-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
FROM debian:buster-slim AS builder


# =========================
# Builder image
# =========================
# Partly derived from the following Dockerfile :
# https://github.com/neomantra/docker-flatbuffers/blob/master/Dockerfile


# Setup basic GCC and CMAKE toolchains
# ====================================
RUN apt-get -y update; \
apt-get -y upgrade; \
apt-get -y install --no-install-recommends \
binutils \
build-essential \
ca-certificates \
cmake \
extra-cmake-modules \
curl \
g++ \
git \
less \
make \
&& \
apt-get clean; \
rm -rf /var/lib/apt/lists/*


# FlatBuffer Build
# ================
# https://github.com/google/flatbuffers/archive/refs/tags/v1.12.0.tar.gz
ARG FLATBUFFERS_ARCHIVE_BASE_URL="https://github.com/google/flatbuffers/archive/refs/tags"
ARG FLATBUFFERS_ARCHIVE_TAG="v1.12.0"
ARG FLATBUFFERS_BUILD_TYPE="Release"
ARG FLATBUFFERS_USE_CLANG="false"

RUN curl -fSL "${FLATBUFFERS_ARCHIVE_BASE_URL}/${FLATBUFFERS_ARCHIVE_TAG}.tar.gz" -o flatbuffers.tar.gz \
&& tar xzf flatbuffers.tar.gz \
&& cd flatbuffers-* \
&& cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${FLATBUFFERS_BUILD_TYPE} . \
&& make \
&& make test \
&& make install \
&& cp src/idl_parser.cpp src/idl_gen_text.cpp /usr/local/include/flatbuffers


# Flatcc Build
# ============
# https://github.com/dvidelabs/flatcc/archive/refs/tags/v0.6.0.tar.gz
ARG FLATCC_ARCHIVE_BASE_URL="https://github.com/dvidelabs/flatcc/archive/refs/tags"
ARG FLATCC_ARCHIVE_TAG="v0.6.0"

RUN curl -fSL "${FLATCC_ARCHIVE_BASE_URL}/${FLATCC_ARCHIVE_TAG}.tar.gz" -o flatcc.tar.gz \
&& tar xzf flatcc.tar.gz \
&& mv flatcc-* flatcc \
&& cd flatcc \
&& env $( if [ "${FLATBUFFERS_USE_CLANG}" = "true" ] ; then echo "CC=/usr/bin/clang CXX=/usr/bin/clang++ " ; fi) \
./scripts/initbuild.sh make \
&& env $( if [ "${FLATBUFFERS_USE_CLANG}" = "true" ] ; then echo "CC=/usr/bin/clang CXX=/usr/bin/clang++ " ; fi) \
./scripts/build.sh



# =========================
# Construct the final image
# =========================
FROM debian:buster-slim


# Setup basic tools
# =================
RUN apt-get -y update; \
apt-get -y upgrade; \
apt-get -y install --no-install-recommends \
build-essential \
curl \
git \
make \
zip \
&& \
apt-get clean; \
rm -rf /var/lib/apt/lists/*


# Flatbuffers (flatc)
# ===================
COPY --from=builder /usr/local/bin/flatc /usr/local/bin/flatc
COPY --from=builder /usr/local/include/flatbuffers /usr/local/include/flatbuffers
COPY --from=builder /usr/local/lib/libflatbuffers.a /usr/local/lib/libflatbuffers.a
COPY --from=builder /usr/local/lib/cmake/flatbuffers /usr/local/lib/cmake/flatbuffers


# Flatcc (flatcc)
# ===============
COPY --from=builder /flatcc/bin/flatcc /usr/local/bin/flatcc
COPY --from=builder /flatcc/include/flatcc /usr/local/include/flatcc
COPY --from=builder /flatcc/lib/*.a /usr/local/lib/


# Source Code (flatcc)
# ====================
COPY --from=builder /flatcc.tar.gz flatcc.tar.gz
RUN tar xzf flatcc.tar.gz \
&& mkdir -p /usr/local/src \
&& mv flatcc-* /usr/local/src/flatcc \
&& rm flatcc.tar.gz


# CMD ["/bin/bash", "-c", "tail /dev/null -f"]
49 changes: 49 additions & 0 deletions docker/python-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM python:3.8.10-slim


# Setup basic tools
# =================
RUN apt-get -y update; \
apt-get -y upgrade; \
apt-get -y install --no-install-recommends \
build-essential \
ca-certificates \
cargo \
curl \
gcc \
git \
less \
make \
python3-dev \
zip \
&& \
apt-get clean; \
rm -rf /var/lib/apt/lists/*


# Python VENV
# ===========
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"


# Python Libraries
# ================
RUN pip install --upgrade pip; pip install \
flatbuffers==1.12 \
msgpack \
numpy \
pip-licenses \
pytest \
twine \
wheel \
&& \
pip list; pip-licenses


# Global PIP config
# =================
COPY pip.conf /etc/pip.conf


# CMD ["/bin/bash", "-c", "tail /dev/null -f"]
2 changes: 2 additions & 0 deletions docker/python-builder/pip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[global]
disable-pip-version-check = True
Loading

0 comments on commit 089489a

Please sign in to comment.