Jump to content
  • 0

Waveforms script that can take Logic1 digital values, perform calculations, and let Patterns1 assign bus values


J.J.

Question

Hi. 

I successfully measured my unit DUT with the forum's help.

Now I am trying to expand the measurement by connecting more DUTs and do some calculations to generate integer values that can be assigned to bus inputs of the DUTs. Most of the controls will be implemented in Script. To be more specific, the whole system goes like this:

  1. 30 MHz clock signal and enable signal are assigned to three DUTs. (This can be done manually, or simply by running Patterns1.run() with settings done in GUI)
  2. Three 5-bit bus values range between integer 0 and 31. Initializing is not that important here.
  3. Logic analyzer will capture 3 DUT digital output signals whenever the sync signal falls. Only one of the three signals will be valid. The other two are prohibited to be changed for three cycles. So the other two values will be replaced with previously saved digital values. (if statement starting from line 50)
  4. Predefined integers are multiplied with corresponding DUT outputs and added to implement a weighted sum (IN1, IN2, IN3).
  5. Weighted sum values will be converted into binary expressions and assigned to corresponding DUTs.

The procedure iterates 1000 times, and each start should be synchronized with falling edge of DIN0. DIN0 receives a 10 MHz toggling signal that comes from a DUT. 

I am having hard time coding how to sync for loop with DIO0, and assigning three 5-bit bus signals with calculated IN1, IN2, IN3.

I attached my workspace. Could someone show me a way to do this?

 

Thanks always.

J.J.

DUT3.dwf3work

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Oh actually I came up with a way to assign buses in Patterns1 through Script.

The appropriate parameter for me was:

// Bus1 named as IN1, and also the calculated integer value is stored in var IN1

Patterns1.Channels.IN1.Number.value = IN1;

Now I am trying to sync iterations of the for loop with a 10 MHz toggling signal that indicates outputs of the DUTs are ready.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...