24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UM-398 15 - Functional coverage with PSL <strong>and</strong> <strong>ModelSim</strong><br />

Creating a reactive testbench with endpoint directives<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong><br />

The PSL endpoint construct is designed to create a symbol in HDL that is set to TRUE for<br />

the simulation time unit when a sequence is matched. The HDL code may test the endpoint<br />

variable thereby allowing the testbench to take some action when a sequence occurs. If the<br />

sequence is used for both an endpoint <strong>and</strong> a cover directive, this is equivalent to writing a<br />

"reactive" testbench that can alter its behavior when a sequence is covered.<br />

The following example shows an endpoint <strong>and</strong> a cover that are derived from the same<br />

sequence. Note that the embedded PSL with the endpoint declaration for<br />

endpoint_a_after_b has to appear before the VHDL process in which the<br />

endpoint_a_after_b signal is tested.<br />

library ieee;<br />

use ieee.std_logic_1164.all;<br />

use std.textio.all;<br />

entity test is<br />

end entity test;<br />

architecture t of test is<br />

signal clk : std_logic := '0';<br />

signal a : std_logic := '0';<br />

signal b : std_logic := '0';<br />

begin<br />

clk

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!