dolcc
来自「基于4个mips核的noc设计」· 代码 · 共 70 行
TXT
70 行
#!/bin/bash# Compile all four nodes of a 2x2 mMips network and run a simulation.# Memory assumptions (0x1000=4k): # 0x0000 - 0x3FFF : Instructions (ROM, 16k)# 0x4000 - 0x4FFF : Reserved for user data (4k).# Address range in C source code: 0x0 - 0xFFF# 0x5000 - 0x7FFF : Data (globals, locals and stack, 12k)# Address range in C source code: 0x1000 - 0x3FFF# 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 500 minutes type: " $0 "500" exitfi# Output start date and time.date# 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 parse.c tree_vld.c huffman.c step1.clcc -N -AA -o mips_rom.x1y0.bin -I$NOCTOOLS/src -L$NOCTOOLS/mmips -lmtools -lstdcomm -lsprintf fast_int_idct.c step2.c lcc -N -AA -o mips_rom.x0y1.bin -I$NOCTOOLS/src -L$NOCTOOLS/mmips -lmtools -lstdcomm -lsprintf color.c step3.c # Create all four RAMs.# The user data portion of memory is used as follows:# * 0x4000-0x4DFF: Input picture (x0y0) or free space (other nodes)# * 0x4E00-0x4FFF: Output of mprintf() debug function.let userdata_end=4096-1let progdata_start=5*4096 # Data in code binary starts at 0x5000 (0x1000=4k)let progdata_end=8*4096-1 # Data segment ends at 0x8000-1./dump test_images/surfer.jpg 0 $userdata_end '\0' > mips_ram.x0y0.bin./dump mips_rom.x0y0.bin $progdata_start $progdata_end '\0' >> mips_ram.x0y0.bin./dump mips_ram.empty.bin 0 $userdata_end '\0' > mips_ram.x1y0.bin./dump mips_rom.x1y0.bin $progdata_start $progdata_end '\0' >> mips_ram.x1y0.bin./dump mips_ram.empty.bin 0 $userdata_end '\0' > mips_ram.x0y1.bin./dump mips_rom.x0y1.bin $progdata_start $progdata_end '\0' >> mips_ram.x0y1.bin# 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 ./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 + -
显示快捷键?