Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Below is a list of the available containers and their included tools.
* [vhd2vl](https://github.com/ldoolitt/vhd2vl)
* [Slang](https://github.com/MikePopoloski/slang)
* [sv2v](https://github.com/zachjs/sv2v)
* [svlint](https://github.com/dalance/svlint)
* [Verible](https://github.com/chipsalliance/verible)
* [Surelog](https://github.com/chipsalliance/Surelog)
* `synthesis`: tools for logic synthesis
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -e
IMAGE=$1
docker build -f recipes/$IMAGE -t ghcr.io/pyfpga/$IMAGE .
docker build -f recipes/$IMAGE --network=host -t ghcr.io/pyfpga/$IMAGE .
4 changes: 4 additions & 0 deletions purge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e
docker rmi -f $(docker images -q)
docker system prune -a --volumes -f
83 changes: 45 additions & 38 deletions recipes/langutils
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
FROM ubuntu:latest AS build
FROM ubuntu:latest AS builder

WORKDIR /root
ENV DEBIAN_FRONTEND=noninteractive

#
# Dependencies
#

RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# Common
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
bison \
build-essential \
ca-certificates \
cargo \
cmake \
curl \
default-jre \
flex \
git \
python3 \
zlib1g-dev \
# vhd2vl
flex \
bison \
# Surelog
cmake \
default-jre \
python3-orderedmultidict \
# sv2v
&& curl -sSL https://get.haskellstack.org/ | sh \
&& curl -sSL https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel-6.5.0-linux-x86_64 \
-o /usr/bin/bazel && chmod +x /usr/bin/bazel \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
# verible
&& curl -fsSL https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64 \
-o /usr/local/bin/bazel && chmod +x /usr/local/bin/bazel \
# clean-up
&& rm -rf /var/lib/apt/lists/*

WORKDIR /tmp

#
# vhd2vl
#

RUN git clone --depth 1 https://github.com/ldoolitt/vhd2vl \
&& cd vhd2vl && make -j$(nproc) && make install

#
# sv2v
#

RUN git clone --depth 1 https://github.com/zachjs/sv2v.git \
&& cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin

#
# Slang
#

RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git \
&& cd slang && cmake -B build && cmake --build build -j8 \
&& cd slang && cmake -B build && cmake --build build -j$(nproc) \
&& cmake --install build --strip

#
Expand All @@ -49,14 +52,12 @@ RUN git clone --depth 1 https://github.com/MikePopoloski/slang.git \

RUN git clone --depth 1 https://github.com/alainmarcel/Surelog.git \
&& cd Surelog && git submodule update --init --recursive \
&& make -j$(nproc) && make install

#
# sv2v
#

RUN git clone --depth 1 https://github.com/zachjs/sv2v.git \
&& cd sv2v && make -j$(nproc) && cp bin/sv2v /usr/local/bin
&& cmake -B build \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
&& cmake --build build -j$(nproc) \
&& cmake --install build --strip

#
# Verible
Expand All @@ -67,18 +68,24 @@ RUN git clone --depth 1 https://github.com/chipsalliance/verible.git \
&& .github/bin/simple-install.sh /usr/local/bin

#
# Clean-up
# svlint
#

RUN cargo install --root /usr/local --git https://github.com/dalance/svlint.git svlint

#
# clean-up
#

RUN cd /usr/local/bin && rm stack
RUN rm -f /usr/local/bin/stack /usr/local/bin/bazel

###############################################################################
# -----------------------------------------------------------------------------

FROM ubuntu:latest
FROM ubuntu:latest AS runtime

COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build /usr/local/lib /usr/local/lib
COPY --from=build /usr/local/include /usr/local/include
COPY --from=build /usr/local/share/pkgconfig /usr/local/share/pkgconfig
COPY --from=build /usr/local/share/surelog /usr/local/share/surelog
COPY --from=build /usr/local/share/uhdm /usr/local/share/uhdm
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /usr/local/include /usr/local/include
COPY --from=builder /usr/local/share/pkgconfig /usr/local/share/pkgconfig
COPY --from=builder /usr/local/share/surelog /usr/local/share/surelog
COPY --from=builder /usr/local/share/uhdm /usr/local/share/uhdm
244 changes: 244 additions & 0 deletions tests/.svlint.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
[option]
exclude_paths = []
textwidth = 80
copyright_linenum = 1
copyright_year = "1234"
copyright_holder = "HOLDER"
indent = 2
prefix_inout = "b_"
prefix_input = "i_"
prefix_output = "o_"
prefix_label = "l_"
prefix_instance = "u_"
prefix_module = "mod_"
prefix_package = "pkg_"
prefix_interface = "ifc_"
re_required_assert = "^[a-z]+[a-z0-9_]*$"
re_required_assert_property = "^[a-z]+[a-z0-9_]*$"
re_required_checker = "^[a-z]+[a-z0-9_]*$"
re_required_class = "^[a-z]+[a-z0-9_]*$"
re_required_function = "^[a-z]+[a-z0-9_]*$"
re_required_generateblock = "^[a-z]+[a-z0-9_]*$"
re_required_genvar = "^[a-z]+[a-z0-9_]*$"
re_required_instance = "^[a-z]+[a-z0-9_]*$"
re_required_interface = "^[a-z]+[a-z0-9_]*$"
re_required_localparam = "^[A-Z]+[A-Z0-9_]*$"
re_required_modport = "^[a-z]+[a-z0-9_]*$"
re_required_module_ansi = "^[a-z]+[a-zA-Z0-9_]*$"
re_required_module_nonansi = "^[A-Z]+[A-Z0-9_]*$"
re_required_package = "^[a-z]+[a-z0-9_]*$"
re_required_parameter = "^[A-Z]+[A-Z0-9_]*$"
re_required_port_inout = "^[a-z]+[a-z0-9_]*$"
re_required_port_input = "^[a-z]+[a-z0-9_]*$"
re_required_port_output = "^[a-z]+[a-z0-9_]*$"
re_required_port_ref = "^[a-z]+[a-z0-9_]*$"
re_required_port_interface = "^[a-z]+[a-z0-9_]*$"
re_required_program = "^[a-z]+[a-z0-9_]*$"
re_required_property = "^[a-z]+[a-z0-9_]*$"
re_required_sequence = "^[a-z]+[a-z0-9_]*$"
re_required_task = "^[a-z]+[a-z0-9_]*$"
re_required_var_class = "^[a-z]+[a-z0-9_]*$"
re_required_var_classmethod = "^[a-z]+[a-z0-9_]*$"
re_forbidden_assert = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_assert_property = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_checker = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_class = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_function = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_generateblock = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_genvar = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_instance = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_interface = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_localparam = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_modport = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_module_ansi = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_module_nonansi = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_package = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_parameter = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_port_inout = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_port_input = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_port_output = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_port_ref = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_port_interface = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_program = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_property = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_sequence = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_task = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_var_class = "^[^X](UNCONFIGURED|.*)$"
re_forbidden_var_classmethod = "^[^X](UNCONFIGURED|.*)$"

[option.unpacked_array]
localparam_declaration = false
param_declaration = false
specparam_declaration = false
inout_declaration = false
ansi_port_declaration = false
input_declaration = false
output_declaration = false
interface_port_declaration = false
ref_declaration = false
data_declaration = true
net_declaration = false

[textrules]
header_copyright = false
style_directives = false
style_semicolon = false
style_textwidth = false

[syntaxrules]
action_block_with_side_effect = false
blocking_assignment_in_always_at_edge = false
blocking_assignment_in_always_ff = false
blocking_assignment_in_always_latch = false
case_default = false
default_nettype_none = false
default_nettype_wire_at_end = false
enum_with_type = false
eventlist_comma_always_ff = false
eventlist_or = false
explicit_brackets_for_confusing_precedence = false
explicit_case_default = false
explicit_if_else = false
function_same_as_system_function = false
function_with_automatic = false
general_always_level_sensitive = false
general_always_no_edge = false
generate_case_with_label = false
generate_for_with_label = false
generate_if_with_label = false
genvar_declaration_in_loop = false
genvar_declaration_out_loop = false
implicit_case_default = false
inout_with_tri = false
input_with_var = false
interface_identifier_matches_filename = false
interface_port_with_modport = false
keyword_forbidden_always = false
keyword_forbidden_always_comb = false
keyword_forbidden_always_ff = false
keyword_forbidden_always_latch = false
keyword_forbidden_generate = false
keyword_forbidden_logic = false
keyword_forbidden_priority = false
keyword_forbidden_unique = false
keyword_forbidden_unique0 = false
keyword_forbidden_wire_reg = false
keyword_required_generate = false
localparam_explicit_type = false
localparam_type_twostate = false
loop_statement_in_always_comb = false
loop_statement_in_always_ff = false
loop_statement_in_always_latch = false
loop_variable_declaration = false
lowercamelcase_interface = false
lowercamelcase_module = false
lowercamelcase_package = false
module_ansi_forbidden = false
module_identifier_matches_filename = false
module_nonansi_forbidden = false
multiline_for_begin = false
multiline_if_begin = false
non_blocking_assignment_in_always_comb = false
non_blocking_assignment_in_always_no_edge = false
operator_case_equality = false
operator_incdec = false
operator_self_assignment = false
output_with_var = false
package_identifier_matches_filename = false
package_item_not_in_package = false
parameter_default_value = false
parameter_explicit_type = false
parameter_in_generate = false
parameter_in_package = false
parameter_type_twostate = false
prefix_inout = false
prefix_input = false
prefix_instance = false
prefix_interface = false
prefix_module = false
prefix_output = false
prefix_package = false
procedural_continuous_assignment = false
program_identifier_matches_filename = false
re_forbidden_assert = false
re_forbidden_assert_property = false
re_forbidden_checker = false
re_forbidden_class = false
re_forbidden_function = false
re_forbidden_generateblock = false
re_forbidden_genvar = false
re_forbidden_instance = false
re_forbidden_interface = false
re_forbidden_localparam = false
re_forbidden_modport = false
re_forbidden_module_ansi = false
re_forbidden_module_nonansi = false
re_forbidden_package = false
re_forbidden_parameter = false
re_forbidden_port_inout = false
re_forbidden_port_input = false
re_forbidden_port_interface = false
re_forbidden_port_output = false
re_forbidden_port_ref = false
re_forbidden_program = false
re_forbidden_property = false
re_forbidden_sequence = false
re_forbidden_task = false
re_forbidden_var_class = false
re_forbidden_var_classmethod = false
re_required_assert = false
re_required_assert_property = false
re_required_checker = false
re_required_class = false
re_required_function = false
re_required_generateblock = false
re_required_genvar = false
re_required_instance = false
re_required_interface = false
re_required_localparam = false
re_required_modport = false
re_required_module_ansi = false
re_required_module_nonansi = false
re_required_package = false
re_required_parameter = false
re_required_port_inout = false
re_required_port_input = false
re_required_port_interface = false
re_required_port_output = false
re_required_port_ref = false
re_required_program = false
re_required_property = false
re_required_sequence = false
re_required_task = false
re_required_var_class = false
re_required_var_classmethod = false
sequential_block_in_always_comb = false
sequential_block_in_always_ff = false
sequential_block_in_always_latch = false
style_commaleading = false
style_indent = false
style_keyword_0or1space = false
style_keyword_0space = false
style_keyword_1or2space = false
style_keyword_1space = false
style_keyword_1spaceornewline = false
style_keyword_construct = false
style_keyword_datatype = false
style_keyword_end = false
style_keyword_maybelabel = false
style_keyword_new = false
style_keyword_newline = false
style_operator_arithmetic = false
style_operator_arithmetic_leading_space = false
style_operator_boolean = false
style_operator_boolean_leading_space = false
style_operator_integer = false
style_operator_integer_leading_space = false
style_operator_unary = false
style_trailingwhitespace = false
tab_character = false
unpacked_array = false
uppercamelcase_interface = false
uppercamelcase_module = false
uppercamelcase_package = false

Loading
Loading