Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into 5-define-a-streaming-protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
JasmijnB authored Mar 1, 2024
2 parents c4d4b25 + cd28ad1 commit 7680e47
Show file tree
Hide file tree
Showing 12 changed files with 325 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .ci/test_whitespace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -xou pipefail

grep \
-E ' $' -n -r . \
--include=*.{hs,hs-boot,sh,cabal,md,yml} \
--exclude-dir=dist-newstyle --exclude-dir=deps
if [[ $? == 0 ]]; then
echo "EOL whitespace detected. See ^"
exit 1;
fi
10 changes: 10 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# Instructions for setting up direnv: https://direnv.net/

if type -P lorri &>/dev/null; then
eval "$(lorri direnv)"
else
echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]'
use nix
fi
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Feature description**
[Describe what the feature should do]

**Expected behaviour**
[Describe what the (testable) result of the feature should be]

**Expected steps**
[What steps do you expect are needed to implement the feature]

**Additional Context**
[Any additional Context]
40 changes: 40 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "CI pipeline"
on:
push:
pull_request:
jobs:
file_endings:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Whitespace file endings
run: |
.ci/test_whitespace.sh
build_and_synthesize:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: install nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: cache nix
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: build the nix environment
run: nix-build
- name: check stylish-haskell
run: nix-shell --run "make check_format"
- name: clean linting process
run: nix-shell --run "make clean_tests"
- name: Test suite
run: nix-shell --run "make test"
- name: Test synthesis
run: nix-shell --run "make verilog"
- name: Create netlist
run: nix-shell --run "make netlist"
- name: Create Place and Route
run: nix-shell --run "make pnr"
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ clean:

format:
stylish-haskell -c ./.stylish-haskell.yaml -r -i src

check_format:
cp ./.stylish-haskell.yaml ./.stylish-haskell-check.yaml
echo "exit_code: error_on_format" >> ./.stylish-haskell-check.yaml
stylish-haskell -c ./.stylish-haskell-check.yaml -r src

clean_tests:
rm ./.stylish-haskell-check.yaml

test:
cabal test

Expand Down
9 changes: 9 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
with import ./nix/nixpkgs.nix {};

stdenv.mkDerivation{
name = "qbaylogic-clash-based-macipudp-stack-spring24" ;
src = ./. ;
installPhase= ''
touch $out
'';
}
5 changes: 5 additions & 0 deletions diagram/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
set -euxo pipefail

plantuml -tsvg layer1+2-arch.puml
plantuml -tsvg uart-eth.puml
61 changes: 61 additions & 0 deletions diagram/layer1+2-arch.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@startuml

skinparam rectangle<<PhyTxDomain>> {
roundCorner 25
backgroundColor Aquamarine
}

skinparam rectangle<<PhyRxDomain>> {
roundCorner 25
backgroundColor LightCyan
}

skinparam rectangle<<PhyRxDomain-To-SystemDomain>> {
roundCorner 25
backgroundColor Fuchsia
}

skinparam rectangle<<SystemDomain-To-PhyTxDomain>> {
roundCorner 25
backgroundColor Fuchsia
}

skinparam rectangle<<SystemDomain>> {
roundCorner 25
backgroundColor Gold
}


rectangle "Phy Receiver" as PhyRx <<PhyRxDomain>>
rectangle "UpConverter" as UpConv <<PhyRxDomain>>
rectangle "AsyncFIFO CDC" as CDCRx <<PhyRxDomain-To-SystemDomain>>
rectangle "Preamble check + strip" as PreRx <<SystemDomain>>
rectangle "Frame check sequence\nvalidation" as FCSRx <<SystemDomain>>
rectangle "MAC depacketizer" as PacketRx <<SystemDomain>>
rectangle "MAC sink" as Sink <<SystemDomain>>

PhyRx -down-> UpConv : last_be :: Maybe (Vec 1 Bool) \nabort :: Bool\npayload :: Vec 1 (BitVector 8)
UpConv -down-> CDCRx : last_be :: Maybe (Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
CDCRx -down-> PreRx : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
PreRx -down-> FCSRx : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
FCSRx -down-> PacketRx : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
PacketRx -down-> Sink : mac_header :: MacHeader\nlast_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)

rectangle "MAC source" as Source <<SystemDomain>>
rectangle "MAC Packetizer" as PacketTx <<SystemDomain>>
rectangle "Frame check sequence\ninserter" as FCSTx <<SystemDomain>>
rectangle "Preamble inserter" as PreTx <<SystemDomain>>
rectangle "AsyncFIFO CDC" as CDCTx <<SystemDomain-To-PhyTxDomain>>
rectangle "DownConverter" as DownConv <<PhyTxDomain>>
rectangle "Interpacket gap inserter" as IPG <<PhyTxDomain>>
rectangle "Phy Transmitter" as PhyTx <<PhyTxDomain>>

Source -up-> PacketTx : mac_header :: MacHeader\nlast_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
PacketTx -up-> FCSTx : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
FCSTx -up-> PreTx : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
PreTx -up-> CDCTx : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
CDCTx -up-> DownConv : last_be :: Maybe(Vec n Bool)\nabort :: Bool\npayload :: Vec n (BitVector 8)
DownConv -up-> IPG : last_be :: Maybe (Vec 1 Bool) \nabort :: Bool\npayload :: Vec 1 (BitVector 8)
IPG -up-> PhyTx : last_be :: Maybe (Vec 1 Bool) \nabort :: Bool\npayload :: Vec 1 (BitVector 8)

@enduml
Loading

0 comments on commit 7680e47

Please sign in to comment.