Skip to content

Commit

Permalink
Has fixed hardcoded path and updated run_mac_docker.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
yyan7223 committed Sep 24, 2024
1 parent c23df89 commit ab6254d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion launchUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ def create_layout_pannel(master, x, width, height):

def clickDisplayLayout():
# Hardcodes the related path, will fix later.
flow_basePath = "/WORK_REPO/CGRA-Flow/tools/OpenROAD-flow-scripts/flow/"
flow_basePath = os.path.dirname(os.path.abspath(__file__)) + "/tools/OpenROAD-flow-scripts/flow/"
layout_path = flow_basePath + "layout.png"
odb_path = flow_basePath + "results/nangate45/gcd/base/6_final.odb"
cmd_path = flow_basePath + "cmd.tcl"
Expand Down
27 changes: 7 additions & 20 deletions run_mac_docker.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
#!/usr/bin/env bash

CONTAINER=cgra/cgra-flow:demo
COMMAND=/bin/bash
NIC=en0
IMAGE=cgra/cgra-flow:demo

# Grab the ip address of this box
IPADDR=$(ifconfig $NIC | grep "inet " | awk '{print $2}')

DISP_NUM=$(jot -r 1 100 200) # random display number between 100 and 200

PORT_NUM=$((6000 + DISP_NUM)) # so multiple instances of the container won't interfer with eachother

socat TCP-LISTEN:${PORT_NUM},reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" 2>&1 > /dev/null &
CONTAINER=CGRA-Flow-OpenRoad

XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth.$USER.$$
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run \
sudo docker run \
-it \
--rm \
--name=$CONTAINER \
-v $XSOCK:$XSOCK:rw \
-v $XAUTH:$XAUTH:rw \
-e DISPLAY=$IPADDR:$DISP_NUM \
-e XAUTHORITY=$XAUTH \
$CONTAINER
-e DISPLAY=unix$DISPLAY \
$IMAGE

0 comments on commit ab6254d

Please sign in to comment.