How to make a core
From Milkymist Wiki
>>>>>>THIS PAGE IS WORK IN PROGRESS and is intended to easily point what is needed to develop new modules for the Milkymist SoC. Teaching Verilog is the not goal at all so that must be complemented else <<<<<<
How to start?
There is AVNET board that will be used for learning purposes as MM1 is not available yet for public in general, for this board there is fork of the Milkymist SoC with basic core functionality:
* LM32 Processor * CRS Bus * GPIO * UART * 16kbits On Chip Ram (2 KBytes)
In the milkymist-avnet directory you'll find two interesting folders:
cores <- source code of cores, you can find both rtl and doc folder for each one boards/avnet-sp3aevl <- related to the synthesis and core setup
The file:
boards/avnet-sp3aevl/sources.mak
Make reference the included sources for the system, so you should consider add the new folders here, appending this:
COUNTER_SRC=$(wildcard $(CORES_DIR)/counter/rtl/*.v)
And fix last line as follow (note new directory is included):
CORES_SRC=$(CONBUS_SRC) $(LM32_SRC) $(CSRBRG_SRC) $(NORFLASH_SRC) $(BRAM_SRC) $(UART_SRC) $(SYSCTL_SRC) $(COUNTER)
This assume also you created the new directory.
Before continue is good idea create a git branch so you can make sure what you change later using commits or even merging code with master branch, run this from the root of milkymist-avnet directory:
git checkout -b counter
Now create new folders:
mkdir cores/counter mkdir cores/counter/rtl mkdir cores/counter/doc
Try make sure git know what changed and or new files added using:
git add <filename>
and when you selected all the files that would be part of the commit, that’s for the end all the tutorial when we got the new feature working :)
Then simply do:
git commit -m "commit message"
For the first edited file:
git add boards/avnet-sp3aevl/sources.mak
Now is time to start coding new core template, before i suggest keep in mind file:
boards/avnet-sp3aevl/rtl/system.v
Later we will need to add some lines there according to the core features and memory mapping.
New core file:
cores/customcore/rtl/counter.v
With the next content:

