For all problems in this homework, you may only use
Unless a problem specifies otherwise.
Implement a Cache that meets the specifications below.
Parameter | Value |
CPU Address | 10 bits |
Cache Data Size | 24 Bytes |
Number of Sets | 2 |
Number of Ways (Blocks per Set) | 3 |
Block Size | 4 Bytes |
Write Policy | Write Back |
Eviction Policy | LRU |
Input Pin | Size (bits) | Description |
CpuAddress | 10 bits | The address the CPU wants to read from or write to |
CpuRead | 1 bit | 1 If the CPU wants to Read and 0 otherwise |
CpuWrite | 1 bit | 1 if the CPU wants to Write and 0 otherwise |
CpuWriteValue | 8 bits | The value the CPU wants to Write. Will only have a meaningful value is CpuWrite = 1 |
LineFromMem | 32 bits | The contents of the block you requested to read from memory |
All of the inputs will only be valid during the SINGLE clock cycle that your Cache says it is Ready. This means that you will have to save your inputs if you need them beyond that first clock cycle.
The only exception to this is LineFromMem. It will be valid as long as you say you want to read from memory. If you aren’t reading from memory LineFromMem will be EEE… and Red (an Error). Don’t worry about this it is normal behavior. As soon as your request to read from memory it will be the value at MemAddress.
Output Pin | Size (in bits) | Description |
Ready | 1 bit | 1 if your Cache is ready to start a new request. If you are ready to start a new request it means you must have finished the old request. So at this point in time, your output will be checked. |
DidContain | 1 bit | 1 if your Cache contained the value the CPU asked for and 0 otherwise. Checked when Ready == 1 |
ByteRead | 8 bits | The value at the address the CPU requested to read. Checked when Ready == 1 and the last request the CPU made was a read. |
MemAddress | 8 bits | The address of the block you want to read from memory. |
MemRead | 1 bit | 1 if you want to read the block at MemAddress and 0 otherwise. |
MemWrite | 1 bit | 1 if you want to write Line2Mem at MemAddress and 0 otherwise. |
Line2Mem | 32 bits | The block you want to MemAddress |
Our Memory is going to be Block Addressable instead of Byte Addressable. This means that each block has an address instead of each byte. This enables you to read a block from/write a block to memory in a single clock cycle which should help simplify your design a little. It should be pretty easy to figure out which bits to drop to form MemAddress. Hint: it is bits that help you pick out the byte within a block.
Your circuit must be able to complete a Read/Write request within 10 clock cycles. If you take longer than 10 clock cycles the tester will automatically advance to the next case. This will cause your Cache to start to “desync” from the tester and so will get everything wrong if you are taking too long. You can certainly finish in less than 10 clock cycles, I only took 7 but I’ve seen students get as low as 2.
Anytime your reset a test case you must RELOAD the RAM! The RAM is the only one that has to be reloaded. The ROM’s will maintain the last value you put in them.
At the bottom of the the main circuit you will find probes that show your circuit’s inputs, outputs, answers, how many reads you got correct, how many times you said you hit, and how many misses(memory reads) you had. This is a good place to look when you are debugging to get a high level overview of what your cache is doing.
If you open the solution files in a text editor you will find what the correct values for all of the stats should be for that test case.
I recommend running the test cases in the following order
If you want to make your own test, you can use cache_test_maker.py to create your own tests. It should be fairly easy to follow the documentation inside if you feel like using it.
Your score is calculated as num_correct_read_values – abs(num_correct_read_value – number_of_reads_you_got_correct) + num_correct_hits – abs(num_correct_hits – your_number_of_hits) + num_correct_misses – abs(num_correct_misses – your_number_of_misses). Essentially you lose points for every value you are off from the right answers.
This might be useful:
https://github.com/NoahRoseLedesma/CacheHitDetector .
A file named Cache.circ with your solution in the implementation subcircuit
Our Advantages
Plagiarism Free Papers
We ensure that all our papers are written from scratch. We deliver original plagiarism-free work. To guarantee this, we submit all work alongside a plagiarism report.
Free Revisions
All our papers are completed and submitted before the deadline. We ensure this to provide you with enough time to go through the work and point out any sections or topics that may need revision or polishing. We provide unlimited revision services for free.
Title-page
All papers have a title page providing your personal and institutional information. We do not charge you for this title page.
Bibliography
All papers have a bibliography or references page. This page is a requirement for academic and professional documents. We provide this page at no cost for all our papers.
Originality & Security
At Thehomeworklabs, we guarantee the confidentiality and security of your information. We value our clients and take confidentiality seriously. All personal information is treated with confidentiality and stored safely to ensure that no third parties gain access to it. We also provide original work and attach an originality/plagiarism report alongside all papers.
24/7 Customer Support
Our customer support team is available 24/7 to provide you with any necessary assistance when you need it. You can contact us at any time, day or night, via email or through the live chat button.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
We provide our customers with the best experience in the academic and business writing field.
Pricing
We provide the best quality of service at affordable prices. We also allow our clients to make partial payments for their orders. You can also contact our customer support team in case you need to discuss a different payment plan.
Communication
Admission help & Client-Writer Contact
We realize that sometimes clarification is necessary to ensure that quality work is done. Therefore, we provide a button for clients and writers to communicate in case some clarification is needed.
Deadlines
Paper Submission
We ensure that we submit all papers ahead of their respective deadlines. This allows you to go through the documents and request any revision, corrections, or polishing before the paper is due.
Reviews
Customer Feedback
We encourage customer feedback, positive or negative. We can identify the various areas that we need to improve to provide even better services through your feedback. Please feel free to give us feedback.