Skip to content

Commit

Permalink
switch to latest naja-verilog (#44)
Browse files Browse the repository at this point in the history
* verilog escaping in progress

* verilog escaping in progress

* testing escaping in progress

* merge main

* switch to main

* Working on docker version for naja_edit

* improve dockerfile

* verilog escaping in dumper

* License cleaning

* debug regress

* cleaning workflows

* print regress versions

* fix path

* full compilation of the regress env. Allows to reproduce in local and to control tools versions

* remove previous docker file

* switch to latest naja-verilog

* update workflow

* clean license

* Update regress.yml

* try another version of ubuntu

* switch to latest

* escape keywords

* trying with apt

* clean again

* fix escaping on assigns
  • Loading branch information
xtofalex authored Mar 12, 2024
1 parent e3ed654 commit 19e7a71
Show file tree
Hide file tree
Showing 21 changed files with 348 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/asan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
# install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/naja_app_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: create docker regress image
run: docker build . --file regress/Dockerfile -t regress
run: docker build . --file Dockerfile.regress -t regress

- name: run regress
run: docker run regress
2 changes: 1 addition & 1 deletion .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v2
2 changes: 1 addition & 1 deletion .github/workflows/snl_python_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install boost & capnproto & valgrind
# install dependencies
run: sudo apt-get update & sudo apt-get install -yq libboost-dev libfl-dev capnproto libcapnp-dev valgrind libtbb-dev
run: |
sudo apt-get update
sudo apt-get -yq install libboost-dev libfl-dev capnproto libcapnp-dev valgrind libtbb-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
Expand Down
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: 2024 The Naja authors <https://github.com/najaeda/naja/blob/main/AUTHORS>
#
# SPDX-License-Identifier: Apache-2.0

FROM alpine:3.19.1 as builder

# Install required packages
RUN apk --no-cache add ca-certificates
RUN apk update && apk upgrade
RUN apk add --no-cache cmake make g++ \
python3-dev capnproto capnproto-dev \
bison flex-dev boost-dev onetbb-dev

# Set the working directory
WORKDIR /naja
COPY CMakeLists.txt /naja/
COPY src /naja/src
COPY test /naja/test
COPY cmake /naja/cmake
COPY primitives /naja/primitives
COPY thirdparty /naja/thirdparty

WORKDIR /naja/build
RUN cmake -DCMAKE_BUILD_TYPE=Release .. && \
cmake --build . --parallel 8 && \
cmake --install . --prefix /naja/install
RUN ctest -j8

FROM alpine:3.19.1 as release
RUN apk --no-cache add ca-certificates
RUN apk add --no-cache \
libstdc++ capnproto python3

RUN addgroup -S naja && adduser -S naja -G naja
USER naja
COPY --chown=naja:naja --from=builder \
./naja/install/bin/naja_edit \
./naja/
COPY --chown=naja:naja --from=builder \
./naja/install/lib \
./naja/lib
ENV LD_LIBRARY_PATH /naja/lib
ENV PYTHONPATH /naja/lib/python
ENTRYPOINT [ "./naja/naja_edit" ]
51 changes: 51 additions & 0 deletions Dockerfile.regress
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: 2024 The Naja authors <https://github.com/najaeda/naja/blob/main/AUTHORS>
#
# SPDX-License-Identifier: Apache-2.0

FROM alpine:3.19.1 as builder

# Install required packages
RUN apk --no-cache add ca-certificates
RUN apk update && apk upgrade
RUN apk add --no-cache \
autoconf automake \
g++ python3 make \
flex-dev bison \
help2man

#compile verilator
RUN wget https://github.com/verilator/verilator/archive/refs/tags/v5.022.tar.gz
RUN tar xvzf v5.022.tar.gz
WORKDIR /verilator-5.022
RUN autoconf && ./configure --prefix=/verilator-install && make -j$(nproc)
RUN make install

#compile yosys
RUN apk add pkgconfig tcl-dev readline-dev libffi-dev git
WORKDIR /
RUN wget https://github.com/YosysHQ/yosys/archive/refs/tags/yosys-0.38.tar.gz
RUN tar xvzf yosys-0.38.tar.gz
WORKDIR /yosys-yosys-0.38
RUN make config-gcc
RUN make -j$(nproc)
RUN make install PREFIX=/yosys-install

#compile naja
RUN apk add cmake \
capnproto capnproto-dev \
python3-dev \
boost-dev onetbb-dev
COPY / /naja
RUN rm -rf /naja/build
RUN rm -rf /naja-install
WORKDIR /naja/build
RUN cmake .. -DCMAKE_INSTALL_PREFIX=/naja-install && make -j$(nproc) && make install

WORKDIR /naja/regress
ENV SET_PYTHONPATH=/naja-install/lib/python
ENV LD_LIBRARY_PATH=/naja-install/lib
ENV NAJA_EDIT=/naja-install/bin/naja_edit
ENV PRIMITIVES=/naja-install/shared/primitives/xilinx.py
ENV YOSYS=/yosys-install/bin/yosys
ENV VERILATOR=/verilator-install/bin/verilator
CMD /yosys-install/bin/yosys -V; /verilator-install/bin/verilator -V; make clean; make
29 changes: 0 additions & 29 deletions regress/Dockerfile

This file was deleted.

Loading

0 comments on commit 19e7a71

Please sign in to comment.