From 137e92f7a3e47399f163cf8473dda102063fdf3f Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Wed, 26 Oct 2016 18:34:10 -0700 Subject: [PATCH] add section to README about adding submodules --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 6c946acc..38daf12b 100644 --- a/README.md +++ b/README.md @@ -352,3 +352,24 @@ route custom0 and custom1 instructions to it, we could do the following. class CustomAcceleratorConfig extends Config( new WithCustomAccelerator ++ new BaseConfig) + +## Adding a submodule + +While developing, you want to include Chisel code in a submodule so that it +can be shared by different projects. To add a submodule to the project +template, make sure that your project is organized as follows. + + yourproject/ + build.sbt + src/main/scala/ + YourFile.scala + +Put this in a git repository and make it accessible. Then add it as a submodule +to the project template. + + git submodule add https://git-repository.com/yourproject.git + +Then add `yourproject` to the `EXTRA_PACKAGES` variable in the Makefrag. +Now your project will be bundled into a jar file alongside the rocket-chip +and testchipip libraries. You can then import the classes defined in the +submodule in a new project.