Merge pull request #637 from lnis-uofu/binder
Added option to copy example projects
This commit is contained in:
commit
f046224e5f
|
@ -48,3 +48,8 @@ message.txt
|
|||
deploy_key
|
||||
openfpga/openfpga
|
||||
vpr/vpr
|
||||
|
||||
# Ignore temp directories
|
||||
node_modules
|
||||
package-lock.json
|
||||
/_*/
|
|
@ -35,7 +35,9 @@ RUN npm install @jupyterlab/server-proxy
|
|||
RUN jupyter serverextension enable --py jupyter_server_proxy
|
||||
RUN jupyter labextension install @jupyterlab/server-proxy
|
||||
RUN jupyter lab build
|
||||
RUN git reset --hard HEAD
|
||||
|
||||
# Set up terminal
|
||||
RUN echo 'export PS1="\[$(tput bold)\]\[\033[38;5;220m\]\u\[$(tput sgr0)\]:\[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;14m\]\W\[$(tput sgr0)\]\\$\[$(tput sgr0) \]"' >> ~/.bashrc
|
||||
RUN mkdir -p .vscode && echo '{"files.associations": {"*.openfpga": "tcl"},"workbench.colorTheme": "Monokai"}' > .vscode/settings.json
|
||||
RUN echo 'alias codeopen="code-server -r "' >> ~/.bashrc
|
||||
RUN mkdir -p .vscode && echo '{"files.associations": {"*.openfpga": "shellscript"},"workbench.colorTheme": "Monokai"}' > .vscode/settings.json
|
||||
|
|
|
@ -30,11 +30,13 @@ Once the ``openfpga.sh`` script is sourced, you can run any following commands d
|
|||
|
||||
.. option:: create-task <task_name> <template>
|
||||
|
||||
It creates a template project with the task name in the current directory.
|
||||
There are two templates currently configurate
|
||||
It creates a template task in the current directory with the given task_name.
|
||||
the template is an optional argument; there are two templates currently configured
|
||||
- ``vpr_blif``: A template task for running flow with `.blif` file as an input (VPR + Netlist generation)
|
||||
- ``yosys_vpr``: A template task for running flow with `.v` file as an input (Synthesis + VPR + Netlist generation)
|
||||
|
||||
you can also use this command to copy any example project; use a ``list-tasks`` command to get the list of example projects
|
||||
for example ``create-task _my_task_copy basic_tests/generate_fabric`` create a copy of the ``basic_tests/generate_fabric`` task in
|
||||
the current directory with ``_my_task_copy`` name.
|
||||
|
||||
.. option:: run-modelsim
|
||||
|
||||
|
|
16
openfpga.sh
16
openfpga.sh
|
@ -40,10 +40,20 @@ create-task () {
|
|||
echo "Task $1 already exists"
|
||||
return
|
||||
fi
|
||||
flow="yosys_vpr"
|
||||
if [ -z $1 ]; then flow=$2; fi
|
||||
template="template_tasks/yosys_vpr_template"
|
||||
if [ ${#2} -ge 1 ]; then
|
||||
if [[ "$2" == "vpr_blif" ]]; then template="template_tasks/${2}_template/";
|
||||
elif [[ "$2" == "yosys_vpr" ]]; then template="template_tasks/${2}_template/";
|
||||
else template="$2"
|
||||
fi
|
||||
fi
|
||||
if [ ! -f $OPENFPGA_PATH/openfpga_flow/tasks/${template}/config/task.conf ]; then
|
||||
echo "Template project [${template}] does not exist" ; return;
|
||||
fi
|
||||
echo "Creating task $1"
|
||||
echo "Template project ${template}"
|
||||
mkdir -p $1
|
||||
cp -r $OPENFPGA_PATH/openfpga_flow/tasks/template_tasks/${flow}_template/* $1/
|
||||
cp -r $OPENFPGA_PATH/openfpga_flow/tasks/${template}/* $1/
|
||||
}
|
||||
|
||||
run-task () {
|
||||
|
|
|
@ -181,3 +181,7 @@ run-task basic_tests/fix_pins --debug --show_thread_logs
|
|||
echo -e "Testing project templates";
|
||||
run-task template_tasks/vpr_blif_template --debug --show_thread_logs
|
||||
run-task template_tasks/yosys_vpr_template --debug --show_thread_logs
|
||||
|
||||
echo -e "Testing create tsk from template and run task"
|
||||
create-task _task_copy basic_tests/generate_fabric
|
||||
run-task _task_copy
|
Loading…
Reference in New Issue