Added option to copy example projects
This commit is contained in:
parent
21c3dbf611
commit
1e243650b9
|
@ -38,4 +38,5 @@ RUN jupyter lab build
|
||||||
|
|
||||||
# Set up terminal
|
# 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 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>
|
.. option:: create-task <task_name> <template>
|
||||||
|
|
||||||
It creates a template project with the task name in the current directory.
|
It creates a template task in the current directory with the given task_name.
|
||||||
There are two templates currently configurate
|
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)
|
- ``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)
|
- ``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
|
.. option:: run-modelsim
|
||||||
|
|
||||||
|
|
16
openfpga.sh
16
openfpga.sh
|
@ -40,10 +40,20 @@ create-task () {
|
||||||
echo "Task $1 already exists"
|
echo "Task $1 already exists"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
flow="yosys_vpr"
|
template="template_tasks/yosys_vpr_template"
|
||||||
if [ -z $1 ]; then flow=$2; fi
|
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
|
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 () {
|
run-task () {
|
||||||
|
|
|
@ -181,3 +181,7 @@ run-task basic_tests/fix_pins --debug --show_thread_logs
|
||||||
echo -e "Testing project templates";
|
echo -e "Testing project templates";
|
||||||
run-task template_tasks/vpr_blif_template --debug --show_thread_logs
|
run-task template_tasks/vpr_blif_template --debug --show_thread_logs
|
||||||
run-task template_tasks/yosys_vpr_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