Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / fpga / Linux / partition_mem
CommitLineData
86530b38
AT
1#!/bin/csh -f
2sleep 10 ;
3set DIR=$0
4set DIR=$DIR:h
5unlimit stacksize
6#limit core 0
7#This bit of code tries to autodetect the dram size build option. Its because big_mem needs to
8#match the set size at run time to what was used at build time. Both the verilog a big_mem default
9#to 1G if no option given
10set init_format
11#If this file already exists, assume that user is merging a memory image with a sims diag.
12#For example the checkpoint flow. So don't overwrite it with the code shown below
13test -f mem.image.add_axis
14#This code allows sims diags to define empty blocks of memory that the dram model can allocate.
15#Useful for DMA diags which just need big buffers to write to.
16if ($status != 0) then
17 test -f symbol.tbl
18 if ($status == 0) then
19 #input:
20 #1empty_blk_start 0000000880040140 0880000140 0880000000
21 #1empty_blk_end 0000000880040140 0880000140 0890000000
22 #2empty_blk_start 0000000880040140 0880000140 08a0000000
23 #2empty_blk_end 0000000880040140 0880000140 08b0000000
24 #output
25 #@880000000//10000000
26 #@8A0000000//10000000
27 grep empty_blk symbol.tbl | \
28 tr "[:lower:]" "[:upper:]" | \
29 nawk 'BEGIN{print "obase=16";print "ibase=16"} /_START/{st_pa=$NF} /_END/{ print st_pa ; print $NF " -" st_pa}' |\
30 bc -l | \
31 nawk ' BEGIN {loop=0} {if (! loop) { printf "@%s//+",$1;loop=1} else {printf "%s\n",$1;loop=0}}' >! mem.image.add_axis
32 endif
33endif
34touch mem.image.add_axis
35#This is the crucial step. small_mem does some simple formatting on the mem image
36#big_mem does the manipulation to allocate entries in a 64 way cache
37cat mem.image mem.image.add_axis | $DIR/small_mem - - | \
38$DIR/big_mem -f - -d . -m 0x40000000 $init_format $*
39set st=$status
40rm -f mem.image.add_axis
41exit $st