dolcc

来自「基于4个mips核的noc设计」· 代码 · 共 78 行

TXT
78
字号
#!/bin/bash# Check whether a simulation time is given.if [ -z "$1" ] ; then    echo "Please specify a simulation time as the second argument, e.g."    echo "to simulate 10 minutes type: " $0 "10"    exitfi# Compile all four nodes of a 2x2 mMips network# Memory assumptions: # 0x0000 - 0x3FFF : Instructions (ROM, 16k)# 0x4000 - 0x4FFF : Reserved for user data.#                   Address range in C source code: 0x0 - 0xFFF# 0x5000 - 0x7FFF : Data (globals, locals and stack, 16k)#                   Address range in C source code: 0x1000 - 0x3FFF# Output start date and time.date# Remove old output files#make clean# Compile all four nodes of the 2x2 network.rm -f mips_rom.x0y0.binrm -f mips_rom.x1y0.binrm -f mips_rom.x0y1.binrm -f mips_rom.x1y1.binlcc -N -AA -o mips_rom.x0y0.bin -I$NOCTOOLS/src -L$NOCTOOLS/mmips -lmtools -lstdcomm -lsprintf gossip.ccp mips_rom.x0y0.bin mips_rom.x1y0.bincp mips_rom.x0y0.bin mips_rom.x0y1.bincp mips_rom.x0y0.bin mips_rom.x1y1.bin# Create all four RAM's. There are two special addresses:# 0x4000    : 4 bytes, node's personal address (= sc_my_address in stdcomm.h).# 0x4004    : 4 bytes, destination address passed as parameter to sc_send()./dump node_info.bin          0     7 '\0'  > mips_ram.x0y0.bin # 8 special bytes../dump node_info.bin       1000  5087 '\0' >> mips_ram.x0y0.bin # 4k-8 zero bytes../dump mips_rom.x0y0.bin  20480 32767 '\0' >> mips_ram.x0y0.bin # Program data (16k)../dump node_info.bin          8    15 '\0'  > mips_ram.x1y0.bin # 8 special bytes../dump node_info.bin       1000  5087 '\0' >> mips_ram.x1y0.bin # 4k-8 zero bytes../dump mips_rom.x0y0.bin  20480 32767 '\0' >> mips_ram.x1y0.bin # Program data (16k)../dump node_info.bin         16    23 '\0'  > mips_ram.x0y1.bin # 8 special bytes../dump node_info.bin       1000  5087 '\0' >> mips_ram.x0y1.bin # 4k-8 zero bytes../dump mips_rom.x0y0.bin  20480 32767 '\0' >> mips_ram.x0y1.bin # Program data (16k)../dump node_info.bin         24    31 '\0'  > mips_ram.x1y1.bin # 8 special bytes../dump node_info.bin       1000  5087 '\0' >> mips_ram.x1y1.bin # 4k-8 zero bytes../dump mips_rom.x0y0.bin  20480 32767 '\0' >> mips_ram.x1y1.bin # Program data (16k).# Make the nodes executables.chmod a-x ./mips_rom*# Do the simulation if the simulation time is > 0.if [ $1 = 0 ]; then    echo "No simulation was started." else    let sim_cycles_one_minute=480000 # Takes about a minute to simulate on CO3.    let sim_time=$1 # Number of minutes to simulate.    let sim_cycles_total=$sim_time*$sim_cycles_one_minute    echo "Estimated simulation time $sim_time minutes.\n"     ./mips $sim_cycles_total    # Replace the results in the dumps directory with the new output.    rm -f ./dumps/*.dump    mv ./mips_ram.x0y0.dump ./dumps    mv ./mips_ram.x1y0.dump ./dumps    mv ./mips_ram.x0y1.dump ./dumps    mv ./mips_ram.x1y1.dump ./dumpsfi# Output end date and time.dateif [ $1 != 0 ]; then    # Echo the debugging info (if present).    ./strings.shfi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?