processor-creative-kit-0.1.0.1: a creation kit for instruction sets and cpu simulators and development tools

Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Pck.Tool.Profiler

Contents

Synopsis

Profiler driver

runProf :: [ProfMode] -> InstImage -> DataImage -> String Source

run the profiler

Example: instruction count profile

 > runProf [ProfInst] [(0,[MOVI R1 0, MOVI R2 8, ST R1 R2, HALT])] []
  instruction profile:
  
    MOVI  2
    HALT  1
    ST    1
  
    total 4

Example: memory store profile

 > runProf [ProfStore] [(0,insts)] []
 Memory store address profile:
 
   address       count
   0x00000000    1
   0x00000001    1
   0x00000002    1
   0x00000003    1
   0x00000004    1
   0x00000005    1
   0x00000006    1
 
   total         7

Example: branch,jump,call profile

 > runProf [ProfBranch] [(0,insts)] []
 Branch/Jump/Call target profile:
 
   address       count
   0x00000007    6
 
   total 6
 
 
 Branch/Jump/Call direction profile:
 
   T/N   count
   Taken 6
   Not   1
 
   total 7

runProfIO :: [ProfMode] -> InstImage -> DataImage -> IO () Source

run the profiler for IO output

Example:

> runProfIO [ProfInst] [(0,[MOVI R1 0, MOVI R2 8, ST R1 R2, HALT])] []
 instruction profile:
 
   MOVI  2
   HALT  1
   ST    1
 
   total 4

prof :: [ProfMode] -> ByteString -> String Source

profile function

Example:

> prof [ProfInst] $ fst $ runDbg [TrcInst] [] [(0,insts)] []
 instruction profile:
 
   MOVI  2
   HALT  1
   ST    1
 
   total 4

Data type

data ProfMode Source

the profile mode for prof, runProf and runProfIO

Constructors

ProfInst

instruction profile

ProfPC

pc profile

ProfCall

call profile

ProfBranch

branch, jump, call profile

ProfLoad

memory load profile

ProfStore

memory store profile

Instances