In this program, you will write the TLB class. You will be given some general descriptors of what must be in the class, along with a statement of functionality. A set of tests will be prescribed so that you can verify that you've constructed the class correctly.
An entry in the TLB (whether micro- or L2) consists of a valid boolean, a tag, an unsigned 32-bit data field, and an integer which contains LRU (Least Recently Used) data (essentially a clock or cycle value used to show how long ago that entry was last accessed).
The TLB constructor takes three parameters, the number of entries in the TLB, the associativity, and the number of bits in the TLB tag.
The constructor would be declared as:
public TLB(int Entries, int Associativity, int TLBTagBits)
The class will have three other methods. One to get data from the TLB, one to set data into the TLB, and a third method to print the contents of the TLB. These methods are further specified as follows:
uint GetData(uint uAddress, uint uCycle)
This method will return the 16-bit physical page number from the TLB. In the case of a miss, the return value is 0xffffffff which would not be a 16-bit page number.
The TLB must take the requested address and decompose it into the set index and tag values. A tag match will be used to determine if there is a hit. In the case of a hit, the data value in the TLB entry is returned.
The cycle number is used to update the LRU field of the TLB entry if it exists. If an entry eviction is later required, the LRU values are used to determine which entry is evicted.
void SetData(uint uData, uint uAddress, uint uCycle)
This method enters data into the TLB. The address is decomposed to find out what set in which the tag will be searched for. If the tag is found, the data is written into the TLB entry data field and the LRU number is updated to the current cycle. If the tag is not found and an empty entry (valid == false) exists in the set, then the data is written to that entry. If no tag is found and no invalid entry exists in the set, the lowest LRU number if not equal to zero is overwritten with the new data, tag, and LRU cycle. An LRU entry of 0 with the valid bit set indicates that the TLB entry is locked, that is to say that it cannot be evicted.
void Print(String strFileName)
Print outputs a text file indicating the TLB contents.
The name of the output files is in the calling parameter.
If the TLB is fully associative, each entry is listed on a separate line. The data fields are entry number, valid bit, the tag, the LRU number and finally the data. All numbers are integer format except data which is output in hex. Fields are tab delimited.
If the TLB is not fully associative, then data from a single set appears on a line. The line does not appear if all entries in the set are invalid. If at least one entry is valid, then the line appears as follows. The set number is output as an integer. This is followed by n blocks od data where n is the associativity. So for a 4-way set associative TLB, the set number would be followed by information from the 4 blocks composing the set. The format of each block is the block number followed by valid status, the tag, the LRU number and the data. Again, only the data is shown in hex; the rest of the numbers are integers.
we are expert in Java and already have delivered numerous small and large size projects. Let us to complete this project for you
Bu iş için 9 freelancer ortalamada $25 teklif veriyor
Greetings!!!!!!! from Maclean Technologies Private Limited. Hello Dear Client, We have an experience more than 3 years with our domestic clients. We provide our best quality, confirmation of project-delivery within Daha Fazla
Dear Sir, You recently advertised your job posting for TLB implementation on this website. I am confident I am a best fit for this project. I WOULD LIKE TO DISCUSS THE PROJECT IN CHAT/ CALL. WE HAVE THE VOIC Daha Fazla