I have been working with the lzw data compression algorithm in which i need to modify to do a few things.
First what I need to do is have in the command line to do a "-r" which resets the...
Type: Posts; User: husslela2
I have been working with the lzw data compression algorithm in which i need to modify to do a few things.
First what I need to do is have in the command line to do a "-r" which resets the...
and then a data cache does reads and stores...
so I would have to create a structure for the d-cache
which could maybe be:
typedef struct dcache
{
basically I am trying to create a Branch History Table.
It takes the index of the least significant bits of the PC counter shifted right by two.
I need to examine the PC counter to determine if it...
i need take the bottom bits of a PC counter >>2.
I took the log of a table of N=1024 entries
i placed a PC counter from a trace file into a temp variable and shifted it to the right >>2.
However...
unsigned char byte_t;
void
cache_create(char name, int assoc, int bsize, int nsets, int usize, int balloc, unsigned int hit_latency, enum cache_policy policy)
{
struct cache_t *cp;
...
ok i've added the clkcntr
#include <stdio.h>
#include <string.h>
// You can include the trace item structure and type by including a header file
#include "mytrace.h"
#define...
Here is what I have now:
unsigned char byte_t;
void
cache_create(char name, int assoc, int bsize, int nsets, int usize, int balloc, unsigned int hit_latency, enum cache_policy policy)
{
...
Hello,
I need to modify this code to allow me to obtain input from the user for how many sets, bytes, associativity, and block size for a cache. I need to simulate based on a d-cache and then an...
I'll edit my code based on what you said then will post it for you to take a look at it.
I'll type up the algorithm i have to do for the branch prediction specs and how it works and see if you...
So basically in each if statement...put how many cycles each type of instruction would take and then have a running total at the end.
I suppose I could base branch prediction off of the clock...
If i wanted to implement a way to count clock cycles and do branch prediction...do you have any suggestions with this code of how to do that?
actually i think i figured it out:
here are my edits:
int bflag;
int temp;
int distance;
if (bflag)
{
ok one more question and then i'm done
i took this code you wrote and i added a variable to count the branch distance, i wanted to shift by two bits to the right
so i implemented this:
int...
I put in the code you showed me, and declared the variables, however now I am getting an error that states that after the switch statement it is unreachable code.
ok so basically, i implemented the strtok();
and I reformatted the printf string to make it where the delimiters can be "] [" and then i want to read in the printf statement...
then take the...
hi:
I have two methods to write in this cache simulator:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Where in the code would i put this, and what is RTM?
Yes! That's exactly what I want to do...how would i do that?
Yes, everytime the branch is accepted by the PC counter on the next instruction, then I want to count that. So if the PC: is different the branch address given in the instruction before, then DO NOT...
sure:
here is a sample of the verbose mode that prints out the trace items.
[item 1] entry ITYPE: (PC: 200cd8) (sReg_a: 2) (sReg_b: 255) (dReg: 2) (addr: 106)
[item 2] entry BRANCH: (PC:...
This code inputs a trace file, and either will print a count of the different instruction types that are called; either an RType, JType, IType, Branch, PC, etc..
If the "print view" is "on" it...
ok how would i write that in C and where would i place it in this code?
So basically I want to say
if %x for a branch equals %x.next of whatever line item it is whether it could be a load instruction or RTYPE, ITYPE, if the target address equals the branch address...
but the branch is not always "taken"
if it's taken the branch target address is used in the next called instruction in the trace file.
That is the branch instructions that I need to count.
Hi:
In my code below, I have a verbose mode which prints results of a trace file.
I need count the branches that are taken.
Which would be if the branch instruction on the line before is used in...