diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..6d7026c5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,59 @@ +# +# Usage: docker build . -t act +# To run (X11 support using tclkit on port 8015->now 443): +# docker run -it -v`pwd`:/work -p443:443/tcp -e DISPLAY="$DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix act +# +# Note: X11 support broken on Ubuntu when docker installed using 'snap' +# +# Use minimal Ubuntu 18.04? Not much better +FROM ubuntu:20.04 AS build + +ENV VLSI_TOOLS_SRC=/work +ENV ACT_HOME=/usr/local/cad +ENV PATH=$PATH:$ACT_HOME/bin +ENV DEBIAN_FRONTEND=noninteractive + +# Install tools needed for development +RUN apt-get update && \ + apt-get upgrade --yes && \ + apt-get install -y --no-install-recommends tzdata && \ + apt-get install -y build-essential m4 libedit-dev zlib1g-dev libboost-dev tcl-dev tk-dev git curl autoconf vim \ + tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer matchbox-window-manager libxss1 + +WORKDIR $VLSI_TOOLS_SRC +COPY . $VLSI_TOOLS_SRC +RUN mkdir -p $ACT_HOME && \ + ./configure $ACT_HOME && \ + ./build && \ + make install + +# git clone https://github.com/asyncvlsi/dflowmap.git && \ -> add dflowmap + +RUN git clone https://github.com/asyncvlsi/interact.git && \ + git clone --branch sdtcore https://github.com/asyncvlsi/chp2prs.git && \ + git clone https://github.com/asyncvlsi/irsim.git && \ + for p in interact chp2prs irsim; do \ + cd $p && (./configure || true) && make depend && make && make install && cd .. \ + ; done && echo "$ACT_HOME/lib" > /etc/ld.so.conf.d/act.conf + +# Build Tclkit +COPY web_irsim.sh $ACT_HOME/bin/ +RUN curl http://kitcreator.rkeene.org/fossil/tarball/kitcreator-trunk-tip.tar.gz?uuid=trunk | tar xvz && \ + cd kitcreator-trunk-tip && build/pre.sh && \ + KITCREATOR_PKGS=" itcl mk4tcl tcllib tk " KC_TCL_STATICPKGS="1" ./kitcreator --enable-64bit --enable-threads && \ + cp `find . -name tclkit-*` $ACT_HOME/bin/tclkit && \ + curl http://cloudtk.tcl-lang.org/Downloads/CloudTk.kit -o $ACT_HOME/bin/CloudTk.kit + +# Cleanup all we can to keep container as lean as possible +RUN apt remove --yes build-essential git autoconf && \ + apt autoremove --yes && \ + rm -rf /tmp/* /var/lib/apt/lists/* $VLSI_TOOLS_SRC + +# This results in a single layer image +# FROM scratch +# COPY --from=build_with_env $ACT_HOME $ACT_HOME + +# Expose Tclkit port +EXPOSE 8015/tcp +# EXPOSE 443/tcp +CMD ["/bin/bash"] diff --git a/microstage.act b/microstage.act new file mode 100644 index 00000000..bf83d524 --- /dev/null +++ b/microstage.act @@ -0,0 +1,45 @@ +defproc inverter (bool? i; bool! o) +{ + prs { + i => o- + } +} +defproc delay (bool? i; bool! o) +{ + inverter d[2]; + d[0].i = i; + d[0].o = d[1].i; + d[1].o = o; +} + +defproc c2 (bool? a, b; bool! c) +{ + prs { + a & b #> c- + } +} + +defproc stage (bool? a,r; bool! a2,r2) +{ + delay d; + inverter i; + c2 c; + + i.i = c.b; i.o = a2; + r = c.a; + d.i = a; d.i = c.c; d.o = r2; +} + +defproc micropipeline (bool? a,r; bool! a2,r2) +{ + stage s[4]; + + s[0].a = a; + s[0].r = r; + s[3].a2 = a2; + s[3].r2 = r2; + + (i : 3 : s[i+1].a=s[i].a2; s[i+1].r=s[i].r2; ) +} + +micropipeline test; diff --git a/muller_c2.act b/muller_c2.act new file mode 100644 index 00000000..3101c92a --- /dev/null +++ b/muller_c2.act @@ -0,0 +1,9 @@ +defproc c2 (bool? a, b; bool! c) +{ + prs { + a & b -> c- + ~a & ~b -> c+ + } +} + +c2 test; diff --git a/web_irsim.sh b/web_irsim.sh new file mode 100755 index 00000000..b56c6963 --- /dev/null +++ b/web_irsim.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +mkdir -p $PWD/Tk/Irsim/ +cat > $PWD/Tk/Irsim/TkStartup.tcl << EOF +set ix [lsearch \$argv -display] +if {\$ix >= 0} { + incr ix + set env(DISPLAY) [lindex \$argv \$ix] + set argc 0 + set argv {} +# source /usr/local/cad/bin/Tk/TkPool/TkPool.tcl +exec /usr/local/lib/irsim/tcl/tkcon.tcl \\ + -eval "source /usr/local/lib/irsim/tcl/console.tcl" \\ + -slave "package require Tk; set argc $#; set argv { $@ }; \\ + source /usr/local/lib/irsim/tcl/irsim.tcl" +} +EOF + +# Just make local copies +cp -n /usr/local/cad/bin/tclkit . +cp -n /usr/local/cad/bin/CloudTk.kit . + +# Default port 8015 tcp +./tclkit ./CloudTk.kit +exit $?