HW5

pdf

School

University of Washington *

*We aren’t endorsed by this school

Course

371

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

16

Uploaded by JusticeOxide4238

Report
1 Design of Digital Circuits and Systems, HW5 Timing Analysis Deliverables 1) Homework problem solutions ( i.e. , text, diagrams, screenshots, work) in a single PDF file. a) At the end of this document, estimate how long you spent working on the homework and rate the difficulty on the following scale: Very Hard — Hard — Moderate — Easy — Very Easy 2) There is no code to submit for this homework. Problems Problem 1: Ben Bitdiddle has designed the circuit shown below to compute a registered four-input XOR function. Each two-input XOR gate has a propagation delay of 100ps and a contamination delay of 55ps. Each flip- flop has a setup time of 60ps, a hold time of 20ps, a clock-to-Q maximum delay of 70ps, and a clock-to-Q minimum delay of 50ps. a. If there is no clock skew, what is the maximum operating frequency of the circuit? b. How much clock skew can the circuit tolerate if it must operate at 2GHz? c. How much clock skew can the circuit tolerate before it might experience a hold time violation? d. Alyssa P. Hacker points out that she can redesign the combinational logic between the registers to be faster and tolerate more clock skew. Her improved circuit also uses three two-input XORs, but they are arranged differently. What is her circuit? What is its maximum frequency if there is no clock skew? How much clock skew can the circuit tolerate before it might experience a hold time violation?
2 Problem 2: You would like to build a synchronizer that can receive asynchronous inputs with an MTBF of 50 years. Your system is running at 1GHz, and you use sampling flip-flops with ࠵? = 100ps, T 0 = 110ps, and t setup = 70ps. The synchronizer receives a new asynchronous input on average 0.5 times per second (i.e. once every 2 seconds). What is the required probability of failure to satisfy this MTBF? How many clock cycles would you have to wait before reading the sampled input signal to give that probability error? Make sure your submitted PDF includes your work. Problem 3: You are walking down the hallway when you run into your lab partner walking in the other direction. The two of you first step one way and are still in each other’s way. Then you both step the other way and are still in each other’s way. Then you both wait a bit, hoping the other person will step aside. You can model this situation as a metastable point and apply the same theory that has been applied to synchronizers and flip-flops. Suppose you create a mathematical model for yourself and your lab partner. You can start the unfortunate encounter in the metastable state. The probability that you remain in this state after t seconds is ࠵? !"/$ , where ࠵? i ndicates your response rate; today, your brain has been blurred by lack of sleep and has ࠵? = 20 seconds. a. How long will it be until you have 99% certainty that you will have resolved from metastability (i.e. figured out how to pass one another)? b. You are not only sleepy, but also ravenously hungry. In fact, you will starve to death if you don’t get going to the cafeteria within 3 minutes. What is the probability that your lab partner will have to drag you to the morgue? Problem 4: Ben Bitdiddle invents a new and improved synchronizer in the figure below that he claims eliminates metastability in a single cycle. He explains that the circuit in box M is an analog “metastability detector” that produces a HIGH output if the input voltage is in the forbidden zone between VIL and VIH. The metastability detector checks to determine whether the first flip-flop has produced a metastable output on D2. If so, it asynchronously resets the flip-flop to produce a good 0 at D2. The second flip-flop then samples D2, always producing a valid logic level on Q. Alyssa P. Hacker tells Ben that there must be a bug in the circuit, because eliminating metastability is just as impossible as building a perpetual motion machine. How is right? Explain, showing either Ben’s error or showing why Alyssa is wrong.
3 Problem 5: This part of the homework is an exercise create by Intel for using the Quartus Prime Timing Analyzer. You will need to download TimingAnalyzer.qar from the hw5 files. Part 1: Project Setup in Quartus Prime Lite 1) Download TimingAnalyzer.qar from Canvas and double-click to open it. If you see a message about Max10, you have the wrong TimingAnalyzer.qar file! 2) A dialogue box will appear. Select a destination folder or use the default location and press OK . Figure 1: Dialogue box that restores the .qar file. 3) In the Project Navigator, click Hierarchy and select Files from the drop-down menu. Double-click on TimingAnalyzer.v to view the Verilog file. It adds two 128-bit numbers and then multiplies the sum by a 32-bit number. Figure 2: In the Project Navigator (top-left), clicking the highlighted title will open the Verilog file (right) for Step 3. The Tasks pane in Quartus (bottom-left) is needed for Step 4. 4) Perform an initial compilation by either double-clicking “ Fitter (Place and Route) ” in the Tasks pane or by going to Processing Start Start Fitter ”. Before applying timing constraints, we This problem will be graded on completion, not correctness. Make sure to include the responses to the questions in red in the directions that follow.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4 need to create an initial database generated from the post-map results of the design. This can also be done with post-fit results, which requires a full compilation. 5) Select Tools TimeQuest Timing Analyzer ” or click the icon. Part 2: Using the Quartus Prime Timing Analyzer Figure 3: The first figure that you see when you open Timing Analyzer. 6) The first thing to do when Timing Analyzer is open is to create a timing netlist. This is done by double clicking “ Create Timing Netlist ” in the Tasks pane. This cannot be done before the initial compilation; Create Timing Netlist requires a post-fit or post-map database.
5 Figure 4: (Left – Step 6) The Tasks pane in Timing Analyzer. Double-clicking any of the blue play buttons will execute the action. (Middle – Step 7) Double-clicking " Read SDC File " will read in the created constraints. (Right – Step 8) Double-click “ Update Timing Netlist ” to access all the reports available. 7) For now, there is no Synopsys Design Constraints (SDC) file in our project. Timing Analyzer will create a default SDC file with one clock when none is found. Double-click “ Read SDC File ” to generate and read this SDC. In the rest of this exercise, you will overwrite this SDC file with your own constraints created in Timing Analyzer. 8) Update the timing netlist by double-clicking “ Update Timing Netlist ”. This creates summaries and reports with useful information. 9) First, create a clock for the design. Do this by going to the main menu and clicking Constraints Create Clock… a) Name it “ clock ” and give it a period of 12.5 nanoseconds. b) Set rising time to 0 and falling time to 6.25 nanoseconds (50% duty cycle). c) For the targets section, click “ ” to search for the clock or just type in exactly what you see in the figure below. i. If you clicked “ ” then the Name Finder from Figure 5b will open. Press List in the dialogue box that appears. Scroll down to select “clock”. Either double-click it or highlight it and press > to add your selection. Finally, press OK . Your Create Clock window should be identical to the one below. You may click “list” and don’t find the “clock” in the list but if you write what you see exactly in the “create clock” pane it should be fine. When the Create Clock window is identical to the one below, press Run . To save time, you can double-click “ Update Timing Netlist ” without doing Steps 6 and 7 individually. Doing this automatically runs the “ Create Timing Netlist ” and “ Read SDC File commands. When you change a design constraint, the background page will be yellow and show “OUT OF DATE” until you update the page again.
6 (a) (b) Figure 5: (a) The Create Clock dialogue window. Click on the " " at the end of the targets section to open the Name Finder window to specify the clock. (b) The Name Finder window where you select your targets for the Create Clock command. 10) On the Tasks pane, scroll down to Diagnostics and double-click “ Report Clocks ” to see what clocks are driving this system. Doing this updates Timing Analyzer with the most recent constraints, so the “OUT OF DATE” yellow page will go away. Here we find the clock that we just created: Figure 6: The clocks in the system followed by all the attributes of the clock. 11) To access any of the reports, find those of interest in the Tasks pane and double-click them. The next steps will look into “ Report Setup Summary ” and “ Report Hold Summary ” to check if our synchronous adder meets setup and hold requirements.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
7 Figure 7: Double-click a report in the Tasks pane to open it. 12) Double-clicking “ Report Setup Summary ” shows us the setup slack of our design. If it is red and negative, then it fails the timing requirements. If it is black and positive, then it passes the timing requirements. a) The “End Point TNS” column in the report reports the total negative slack , the negative slack of all possible paths summed together. b) The “Slack” column reports the slack of the data path that fails the worst. c) The “Clock” column reports which clock drives the design. Your results may vary from the following screenshots: (a) (b) Figure 8: (a) The setup slack of our design. It is red and negative, meaning that the setup slack requirements were not met. (b) The hold slack of our design. It is black and positive, meaning that the hold slack requirements were met. 13) Double-clicking “ Report Hold Summary ” reveals that hold timing passes. Here, the path that comes closest to failing timing has 1.665 ns of slack. Your results may vary from the above screenshot.
8 14) Generate a timing report on our clock to investigate the setup violation. Do this from the Report Clocks summary window. a) Open the dialogue box shown to the right by either: i. Right-clicking “clock” and then clicking Report Timing… ” OR ii. Scroll down in the Tasks pane to “Custom Reports” and double-clicking “ Report Timing… b) The Clocks section allows you to decide which clock in the design you want the report on. There is only one, so select clock as shown to the right. c) The “ Analysis Type ” section determines which report you will see. Select Setup first. d) The Paths section allows us to select how many paths will be shown. It will show the paths that have the least slack first, so entering 1 will show us the single worst path. e) Finally, click “ Report Timing ” to see this custom report. 15) The resulting report has several parts of interest: a) Under “ Summary of Paths ” (tab in the top window), the first column shows the setup slack of the paths that fail timing the worst in descending order. The next two columns define where this path starts and ends, followed by other clock details. b) The “ Data Arrival Path ” (in the “Data Path” tab in the lower-left window) is equivalent to the Data Arrival Time from the slack equation, but shown in much more detail. It is possible to trace the entire path with the information shown below. c) The “ Data Required Path ” is similarly equivalent to the Data Required Time from the slack equation. These values can be used to manually confirm Timing Analyzer’s result for setup slack. d) The Waveform viewer on the bottom-right gives a graphical view of each of the components in the slack equations. Figure 9: The " Report Timing… " dialogue box.
9 Figure 10: The result of the custom timing report. 16) Setup Slack = Data Required Time – Data Arrival Time . First, trace the “ Data Required Path ” to find all the delays along the clock path to the destination register. a) The Total column counts all of the delay up to that point. b) The Incr column shows the increment by which each row adds to the delay. c) The Type column describes where the delay originates from. d) The Fanout column shows how many outputs leave that unit. e) The Location column tells you where in the FPGA it can be found. f) The Element column describes what part of the design we are describing.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
10 Figure 11: The " Data Required Path ," whose total delays add up to equal the data required time. 17) Trace the “ Data Arrival Path ” to view all the delays involved in the data’s transfer from the source to the destination register. Use the Location column to see where in the FPGA the data is. Figure 12: The " Data Arrival Path ," whose total delays add up to equal the data arrival time. 18) What element adds the most delay? How can we change the clock parameters such that setup slack does meet timing requirements? 19) Repeat the “ Report Timing… ” steps to investigate the hold slack results. Does the same element add the most delay for hold slack? Why does this make sense?
11 20) Edit the clock constraint such that setup slack no longer fails timing. This can be done directly in the SDC file or by using the Timing Analyzer GUI: a) Double-click on “ Report Clocks ” in the Tasks pane. b) Right-click “clock” and select “ Edit Clock Constraint… ”. c) Enter the clock period that would make setup slack pass timing requirements. Make sure the rising time is at 0 and the falling time is at half of the clock period. d) Once finished, hit Run . Figure 13: The " Create Clock " GUI in Timing Analyzer allows you to specify clock frequency, as well as rising and falling times. It presents the equivalent SDC command in the bottom text box. Edit the highlighted boxes to make setup slack meet timing requirements! 21) The “ Clocks Summary ” window should now be yellow and show that it is out of date. Write the recent clock creation to an SDC file by selecting Constraints Write SDC File… ” and the newly created clock will overwrite the default one in the SDC file. Your dialogue box should look exactly the same as Figure 14. Press Ok . Figure 14: The " Write SDC File... " dialogue box for saving an SDC constraint created in the GUI. 22) Double-click “ Update Timing Netlist ” to view the new reports from your design with the updated clock. You can see the updated clock in the “ Report Clock ” summary page now. Double-click on Report Setup Summary ” to see if timing is met with these new conditions. Your results will different from the following screenshots depending on your chosen clock period. What is the fastest frequency you can set the clock to for this to pass setup timing?
12 Figure 15: The new setup summary reveals that timing does pass if the clock is adjusted to the proper frequency. 23) Generate another timing report exactly as you did in Step 14 by selecting “ Custom Reports Report Timing… ” in the Tasks pane. The design now passes timing. Investigate how it’s different. 24) Timing Analyzer only works completely when the designer enters constraints for all possible paths and clocks. Check if there are unconstrained paths by scrolling down in the Tasks pane in the Diagnostics section and double-clicking “ Report Unconstrained Paths .” A completely constrained design has 0 unconstrained ports, paths, and clocks. Figure 16: The report containing the number of unconstrained paths in the design.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
13 25) Constrain the input ports and paths by adding a minimum and maximum set_input_delay . a) To add the constraints in Timing Analyzer, click Constraints Set Input Delay… ”. Use -0.5 ns as the minimum delay and 6.5 ns as the maximum delay ( i.e. , do steps 25 & 26 for each). b) After setting the clock name to “clock” and the delay value to the proper number, click the ” to the right of the Targets section highlighted below to add all the inputs. Figure 17: The set_input_delay GUI window. 26) Press List to see all the ports in our design. Select every port that begins with A, B, and C (besides clock) and press the > button to add them. Press OK. Figure 18: The window that selects which ports to apply the set_input_delay to. 27) The Unconstrained Paths Summary should now have a yellow background with “OUT OF DATE” watermarks across the page. Double-click “ Report Unconstrained Paths ” in the Tasks pane to update it with your recent actions. Similarly, set the min output delay to -0.5 ns and max output delay to 5.6 ns for all sum outputs. Double-clicking “ Report Unconstrained Paths ” from the Tasks pane should reveal that there are zero unconstrained paths remaining.
14 28) Once you’ve finished adding all the constraints, click Constraints Write SDC File… ” to save them (same as Step 21 and Figure 14). Now open the SDC file from your working directory. Look around and see how much time Timing Analyzer saved you by making all these for you! There should be the created clock, as well as all the minimum and maximum set_input_delay and set_output_delay constraints you created. 29) All the new constraints, however, have created a hold violation within our system. Double-click Report Hold Summary ” to verify this. Figure 19: The hold slack report which reveals the hold violation. 30) To fix the hold violation, we will first add our SDC file to the Quartus project and then re-run the fitter. It will take into account every constraint we have made when making decisions for how to route the design. To add the SDC file, go back to the Quartus window and click Project Add/Remove Files in Project… ”. a) Click “ ” and navigate to your working directory. Figure 20: The " Add/Remove Files in Project… " dialogue window. b) Change the file type to “ All Files (*.*) ”. Find the .sdc file and select it. Press Open . Figure 21: To select the .sdc file, change the file type to "All Files" and select the only SDC file you see.
15 c) Press Ok . You have now added the SDC file to your design. Verify it is there by going to your Project Navigator and selecting Files from the drop-down tab. Figure 22: The Project Navigator showing the list of files in the project. d) Finally, run the Fitter again. This time the Fitter will make decisions while considering all the user entered timing constraints. 31) Open Timing Analyzer again. In the Tasks pane, double-click “ Update Timing Netlist ” and then double-click “ Report Hold Summary .” The design should now pass both setup and hold timing requirements! 32) Temperature and voltage have known effects on the speed of a circuit. Quartus by default will assume “Slow 1100mV 85C Model” (the 1200 mV shown in the image below is for another board). We can change this using the “ Set Operating Conditions ” tab. You will see additional options (Slow/Fast, 85C/0C). Select each new model and then double-click “ Report Setup Summary ” in the Tasks pane to compute the setup slack for that model. The corresponding model name under the “Summary (Setup)” folder in the Report pane will change from yellow to black or red. Figure 23: Clicking Set Operating Conditions will allow the designer to choose from one of three conditions Quartus makes timing calculations based off of. The numbers will vary depending on the frequency/period you selected for your clock.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
16 33) Now use the “Summary (Setup)” reports to answer the following questions: a) Which of the options has the most setup slack? b) How does increasing voltage speed change the speed of a circuit? c) How does increasing temperature change the speed of a circuit? 34) Repeat Steps 32-33 for hold slack .