Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds a Ubuntu image with all the tools #22

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
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
59 changes: 59 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
45 changes: 45 additions & 0 deletions microstage.act
Original file line number Diff line number Diff line change
@@ -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;
9 changes: 9 additions & 0 deletions muller_c2.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defproc c2 (bool? a, b; bool! c)
{
prs {
a & b -> c-
~a & ~b -> c+
}
}

c2 test;
25 changes: 25 additions & 0 deletions web_irsim.sh
Original file line number Diff line number Diff line change
@@ -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 $?