HVI Flowcharts

Flowcharts represent a program or execution sequence by means of instructions and flow-control boxes (called statements), and timing arrows. Statements define HVI actions, while arrows define the execution flow and timing. All these elements are explained throughout this section.

 

Timing Arrows

Timing Arrows define and inform about the time between statements. Therefore, the user may thing as if statements do not take any time and all the timing information is given by the Timing Arrows. There are two kind of arrows:

 

Synchronization:  Dashed arrows indicate a desynchronization between the modules which is being recovered by introducing a Synchronized Flow-control Statement.

Synchronized Flow-Control Statements

Flow-control statements are elements that control the HVI execution flow. Synchronized Flow-Control Statements are particular Flow- control Statements that are executed in all modules at the same time.

 

Synchronization Recovery: Some statements like Wait, For Blocks or While Blocks may have an undefined execution time while programming (their timing is only defined during runtime). Therefore, these statements produce a desynchronization of the modules. Synchronized Flow-Control Statements can be used as synchronization elements after a desynchronization.

 

Synchronized and Local Flow-control Statements Colors: Synchronized Flow-Control Statements are show in the flowchart as violet elements, while Local Flow-Control Statements are show as yellow elements.

 

Start

Every flowchart begins with a Start Statement (Figure 3), which is in fact a Synchronized Junction Statement (Figure 4), This statement ensures that all the hardware modules in an HVI start the execution fully synchronized.

 

Junction Statement: The Start Statement is really a Junction Statement (Synchronized Junction), and therefore can be used as a destination for Conditional Statements (Figure 4).

 

End

The End Statement indicates the end of the HVI execution, and must be placed by the user to terminate the HVI properly (Figure 3).

 

Synchronized Junction

A Synchronized Junction Statement is an element that can be used as a destination for conditional jumps (Synchronized Conditional).

Synchronization Recovery: In addition to operate as a destination for conditional jumps, the Synchronized Junction Statement is ideal to perform synchronization recovery (Figure 4).

 

Figure 3: Flowcharts of two modules, showing the Start and the End Statements

Figure 4: A Synchronized Junction Statement (ellipse-shaped element) can also be used to synchronize flowcharts

 

Synchronized Conditional

M3601A allows the user to perform conditional jumps to control the HVI execution flow, enabling the implementation of ultra-fast decision making, loops, etc.

A synchronized jump in the execution flow requires two elements:

  1. Synchronized Conditional Statement, which is the element that evaluates the condition and performs the jump
  2. Destination element.

The latter can be the statement right below the conditional or a Junction Statement placed anywhere in the flowchart (Figure 5).

 

Master and slave synchronized conditionals: In a Synchronized Conditional Statement, the decision is taken by only one of the modules (called master), and all the others (slaves) will comply with the same conditional result.

 

Synchronization Recovery: Like any other Synchronized Flow-control Statement, a Synchronized Conditional will synchronize all modules after a desynchronization.

 

Local Flow-control Statements

Flow-control Statements are elements that control the HVI execution flow. Local Flow-Control Statements are particular Flow-control Statements that are executed only in one module, without affecting the execution flow of other modules.

 

Figure 5: A Synchronized Conditional Statement (diamond-shaped element) jumps to a Junction Statement (ellipse-shaped element) in two modules exactly at the same time. The GUI maintains the synchronization by adjusting automatically the time of the last Timing Arrow. The solid dot in the arrow below the Conditional indicates the jump under a FALSE condition evaluation, while the side branch indicates the jump under a TRUE condition evaluation.

 

Synchronized and Local Flow-control Statements Colors: Synchronized Flow-Control Statements are show in the flowchart as violet elements, while Local Flow-Control Statements are show as yellow elements.

 

If Block

The If Block Statement is the classical ”if/else structure” available in any programming language. The If Block provides two operation options:

 

 

Figure 6: An If Block with equal timing in both branches does not desynchronize

 

Figure 7: An If Block with different timing in both branches desynchronizes, as it it shown in the flowchart of the other modules (right)

 

 

For Block

The For Block Statement is the classical ”for loop structure” of any programming language. The user can choose which local register (M3601A HVI Design Environment Basics) is used for the loop index, and the exit value (number of loops).

Undefined number of loops: If the number of loops is not fixed at programming time (e.g. it is defined by a local register), the For Block Statement desynchronizes.

 

Figure 8: For Block Statement

 

While Block

A While Block Statement is the classical ”while loop” structure of any programming language. The execution loops while a condition is fulfilled.

 

Undefined number of loops:  Like in the case of the For Block, if the exit condition depends on registers (which values are only defined at runtime), then the While Block desynchronizes.

 

Figure 9: While Block Statement

 

 

Wait

The Wait Statement can be configured to wait for two different events:

 

 

Undefined waiting time: The exit condition of the Wait Statement depends on registers (which values are only defined at runtime) or external signals (e.g. PXI triggers), therefore the execution time is not well defined at programming time, producing desynchronization. The Timing Arrow below the Wait Statement informs about the undefined execution time by adding a question mark to the specified time (Figure 10).

 

Figure 10: Wait Statement with an undefined execution time (left flowchart). This timing uncertainty can be seen in the arrow below the Wait. Please note that this also produces a desynchronization, which is shown with the dashed arrows above the Synchronized Junction. The latter performs a synchronization recovery in both modules (left and right).

 

PXI triggers:  PXI triggers are dedicated lines available in the PXI backplane, and can be used at will to exchange signals between modules.

 

ADVANCED: Converting a Local Wait into a Synchronized Wait : By inserting a Synchronized Junction after a Wait, all modules will be forced to wait for the module that takes more time to reach the junction, as the junction resynchronizes all flowcharts.

 

Instruction Statements

Instruction statements describe the main actions of an HVI, without altering the execution flow directly.

Built-in Instructions

Built-in instructions are the main execution statements of an HVI. There are two kind of instructions statements: module-specific, e.g. an instruction to change the amplitude of an Arbitrary Waveform Generator (AWG) (built-in module-specific instructions are described in the User Guide of the module), and universal instruction statements, like arithmetic operations, etc., which are available in all Keysight compatible modules with -HV1 programming enabled option.

Instruction Execution Latency: Instructions are triggered according to the statement timing within the flowchart, however each module-specific instruction has its own execution latency. Check the module datasheet for latency values.

 

Built-in Instructions: Universal

This chapter describes the universal instruction statements available in all modules.

 

MathAssign (D=S)

This function copies the value of the source parameter (S) into the destination variable (D).

Parameters

Name Description
   
Inputs  
Destination Destination local register
Source

Source value to be assigned:
· Constant in the specified format (Decimal, Binary, Hexadecimal, etc.)

· Source local register
· Module-specific digital values

 

MathArithmetics (R=A[+-*/]B)

This function subtracts, adds, multiplies or divides the values of the operands A and B, writing the result in R.

Parameters

Name Description
   
Inputs
Result Destination local register
A First operand of the arithmetic operation:
· Constant in the specified format (Decimal, Binary, Hexadecimal, etc.)
· Source local register
· Module-specific digital values
Operation Arithmetic operation (+, -, *, /)
B Second operand of the arithmetic operation:
· Constant in the specified format (Decimal, Binary, Hexadecimal, etc.)
· Source local register
· Module-specific digital values

 

MathLogic (R=A [op] B)

This function performs a logic operation with the values of the operands A and B, writing the result in R.

Parameters

Name Description
   
Inputs  
Result Destination local register
A First operand of the operation:
· Constant in the specified format (Decimal, Binary, Hexadecimal, etc.)
· Source local register
· Module-specific digital values
Operation Logic operation (and, or, xor, etc.)
B Second operand of the operation:
· Constant in the specified format (Decimal, Binary, Hexadecimal, etc.)
· Source local register
· Module-specific digital values

 

MathSQRT (R=sqrt(A))

This function performs the square of the source parameter (A), writing the result in R.

Parameters

Name Description
   
Inputs  
Destination Destination local register
A Source value to be assigned:
· Constant in the specified format (Decimal, Binary, Hexadecimal, etc.)
· Source local register
· Module-specific digital values

 

HVIport

This function performs a read or write operation on port HVI available in M3602A.

Parameters

Name Description
   
Inputs  
Port Port index of HVI port
Operation Defines if it’s a read or write operation
Address Offset from HVI port base address expressed in double words
Source (Available only on write operation) Source value to be write on HVI port
Destination (Available only on read operation) Destination local register

 

Built-in Instructions: Module-specific

Module-specific instructions are explained in the user guides of the corresponding hardware modules.

 

External Variable Access

This statement writes or reads into/from a variable of another module (M3601A HVI Design Environment Basics).

 

External Variable Access time: The execution time of the External Variable Access Statement is undefined, because it depends, among others, on the data bus bandwidth and congestion. For this reason, this statement produces a desynchronization and dashed Time Arrows will appear in the flowcharts (see Timing Arrows for more details).