Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


bp

The bp or breakpoint command either sets a file-line breakpoint or returns a list of currently set breakpoints. A set breakpoint affects every instance in the design unless the
-inst <region> argument is used.

Syntax

bp

<filename> <line_number> [-id <id#>] [-inst <region>] [-disable]
[
-cond {<condition_expression>}] [{<command>...}]

bp

[-query <filename> [<line_number> [line_number]]]

Arguments for setting breakpoints

<filename>

Specifies the name of the source file to set the breakpoint in. Required.

<line_number>

Specifies the line number at which the breakpoint is to be set. Required.

-id <id#>

Attempts to assign this id number to the breakpoint. Optional. If the id number you specify is already used, ModelSim will return an error.


Note: Ids for breakpoints are assigned from the same pool as those used for the when command. So, even if you haven't used an id number for a breakpoint, it's possible it is used for a when statement.

-inst <region>

Sets the breakpoint so it applies only to the specified region. Optional.

-disable

Sets the breakpoint in a disabled state. Optional. You can enable the breakpoint later using the enablebp command. By default, breakpoints are enabled when they are set.

-cond {<condition_expression>}

Specifies condition(s) that determine whether the breakpoint is hit. Optional. If the condition is true, the simulation stops at the breakpoint. If false, the simulation bypasses the breakpoint.

The condition can be an expression with these operators:

Name
Operator
equals
==, =
not equal
!=, /=
AND
&&, AND
OR
||, OR

The operands may be item names, signame'event, or constants. Subexpressions in parentheses are permitted. The command will be executed when the expression is evaluated as TRUE or 1.

The formal BNF syntax is:

condition ::= Name | { expression }

expression ::= expression AND relation
              | expression OR relation
              | relation 
relation ::= Name = Literal
           | Name /= Literal
           | Name ' EVENT
           | ( expression ) 
Literal ::= '<char>' | "<bitstring>" | <bitstring> 

The "=" operator can occur only between a Name and a Literal. This means that you cannot compare the value of two signals; i.e., Name = Name is not possible.

{<command>...}

Specifies one or more commands that are to be executed at the breakpoint. Optional. Multiple commands must be separated by semicolons (;) or placed on multiple lines. The entire command must be placed in curly braces.

Any commands that follow a run or step command will be ignored. A run or step command terminates the breakpoint sequence. This applies if macros are used within the bp command string as well. A restore command should not be used.

If many commands are needed after the breakpoint, they can be placed in a macro file.

Arguments for listing breakpoints

-query <filename> [<line_number> [line_number]]

Returns information about the breakpoints set in the specified file. The information returned varies depending on which arguments you specify. See the examples below for details.

Examples

bp

Lists all existing breakpoints in the design, including the source file names, line numbers, breakpoint id#s, and any commands that have been assigned to breakpoints.

bp alu.vhd 147

Sets a breakpoint in the source file alu.vhd at line 147.

bp alu.vhd 147 {do macro.do}

Executes the macro.do macro file after the breakpoint.

bp -disable test.vhd 22 {echo [exa var1]; echo [exa var2]}

Sets a breakpoint at line 22 of the file test.vhd and examines the values of the two variables var1 and var2. This breakpoint is initially disabled. It can be enabled with the enablebp command.

bp test.vhd 14 {if {$now /= 100} then {cont}}

Sets a breakpoint in every instantiation of the file test.vhd at line 14. When that breakpoint is executed, the command is run. This command causes the simulator to continue if the current simulation time is not 100.

bp -query testadd.vhd

Lists the line number and enabled/disabled status (1 = enabled, 0 = disabled) of all breakpoints in testadd.vhd.

bp -query testadd.vhd 48

Lists details about the breakpoint on line 48. The output comprises six pieces of information: the first item (0 or 1) designates whether a breakpoint exists on the
line (1 = exists, 0 = doesn't exist); the second item is always 1; the third item is the file name in the compiled source; the fourth item is the breakpoint line number; the fifth item is the breakpoint id; and the sixth item (0 or 1) designates whether the breakpoint is enabled (1) or disabled (0).

bp -query testadd.vhd 2 59

Lists all executable lines in testadd.vhd between lines 2 and 59.


Note: Any breakpoints set in VHDL code and called by either resolution functions or functions that appear in a port map are ignored.

See also

add button, bd, disablebp, enablebp, onbreak, when


Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase