Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial version of SCAN_INSERTION bus definition #21

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

drom
Copy link
Member

@drom drom commented Apr 16, 2020

New bus definition.
To be consumed by DFT scan insertion tools.
See examples here: https://observablehq.com/@drom/scan-bus-definition

@drom drom requested review from fferhani and rpadler April 16, 2020 22:27
Copy link

@fferhani fferhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the CLOCK_EN port has isClock set to true? Clock enable signal are not clocks because they don't synchronize sequential elements.

Copy link

@fferhani fferhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there are several TEST_MODE ports? Must TEST_MODE be unique?

Copy link

@fferhani fferhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there are several SI, SO, and TEST_MODE ports in the same SCAN_INSERTION interface? Must they be unique?

@drom
Copy link
Member Author

drom commented Apr 16, 2020

What if there are several TEST_MODE ports? Must TEST_MODE be unique?

Good point. Is it a viable case? Same with TEST_MODE being a vector?

@drom
Copy link
Member Author

drom commented Apr 16, 2020

What if there are several SI, SO, and TEST_MODE ports in the same SCAN_INSERTION interface? Must they be unique?

I think we should have one interface per chain. SE, SI, SO to be unique.

@drom
Copy link
Member Author

drom commented Apr 16, 2020

What if there are several TEST_MODE ports? Must TEST_MODE be unique?

How about this:

Example 1:

{
  TEST_MODE: 'test_mode' // active high test mode input
}

Example 2:

{
  TEST_MODE: '~test_mode_n' // active low test mode input
}

Example 3:

{
  // 0, 1, 0 -- values should be applyed to the inputs in scan mode
  TEST_MODE: ['~test_ce', 'TestMode', '~powerdown']  
}

@fferhani
Copy link

@drom yes that looks good. What about SI and SO? What if you have test_si0,..., test_si499 and what if you have a bus like test_si[0:499]?

@drom
Copy link
Member Author

drom commented Apr 16, 2020

@drom yes that looks good. What about SI and SO? What if you have test_si0,..., test_si499 and what if you have a bus like test_si[0:499]?

Something like this?

{
  SI: ['test_si0', 'test_si1', ..., 'test_si499']
}
{
  SI: 'test_si' // 500-bit vector
}

@fferhani
Copy link

So if you have a bus like test_si[0:499] it would be
{ SI: ['test_si[0], 'test_si[1]', ..., 'test_si[499]'] }

Yes I think that would work!

@drom
Copy link
Member Author

drom commented Apr 16, 2020

So if you have a bus like test_si[0:499] it would be
{ SI: ['test_si[0], 'test_si[1]', ..., 'test_si[499]'] }

Yes I think that would work!

For vectors you don't need to slice and reconcatenate them back.

{
  SI: 'test_si' // 500-bit vector signal
}

@fferhani
Copy link

fferhani commented Apr 16, 2020

Yes but I can't define the scan input as a bus. I have to define it like this to the scan insertion tool:

set_dft_signal -view spec -type ScanDataIn -port DAT_IN[7]
...
set_dft_signal -view spec -type ScanDataIn -port DAT_IN[0]

So I need to know the beginning and the end of the bus index. Where is that information in the spec below?
{
SI: 'test_si' // 500-bit vector signal
}

@fferhani
Copy link

fferhani commented Apr 17, 2020

Also @drom how do you do linebreak in a code snipet? When I write

code line 1
code line 2

in between backticks I get
code line 1 code line 2

@drom
Copy link
Member Author

drom commented Apr 17, 2020

Also @drom how do you do linebreak in a code snipet? When I write

code line 1
code line 2

in between backticks I get
code line 1 code line 2

https://www.markdownguide.org/extended-syntax/#fenced-code-blocks

@fferhani
Copy link

@drom explained that another section of the DUH file specifies the bus width. What if we have a test_mode [0:2] bus that needs to be 010 in scan mode? How would this be expressed? Like this?

{
    TEST_MODE: ['~test_mode[0]', 'test_mode[1]', '~test_mode[2]']  
}

Copy link

@fferhani fferhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drom confirmed that if we have a test_mode [0:2] bus that needs to be 010 in scan mode it can be expressed like this. I am approving this PR!

{
    TEST_MODE: ['~test_mode[0]', 'test_mode[1]', '~test_mode[2]']  
}

@drom
Copy link
Member Author

drom commented Apr 20, 2020

@fferhani do you think we should capture active-low reset as:

{
  RESET: '~reset_n'
}

Similar to TEST_MODE ?

@drom
Copy link
Member Author

drom commented Apr 20, 2020

@fferhani do we need to capture synchronous resets?

@drom
Copy link
Member Author

drom commented Apr 20, 2020

@fferhani
Do you need Clock constraints, like frequency?
Do you mind if we capture clock frequency in this bus interface for other uses?

@rpadler
Copy link
Contributor

rpadler commented Apr 23, 2020

I don't agree that the scan interface should have clock or reset in it. First off it's not just 1 clock or reset. Instead for each clock/reset that is input to the IP you need
1.) the fastest clock source that is attached to the clock pin to be the muxable/overridable/controllable one
2.) any/all resets must be bypassable.

Thus, I believe the scan interface should just be mapping to the IPs, test_mode and clockgate_en signals. IT's not clear if there should also be a dedicated reset_bypass_en or if test_mode is always sufficient.

For clock/reset handling, we need to instead publish the algorithm that needs to be implemented for proper DFT. That algorithm for clocks is something like:

foreach clk_pin in ip.clocks:
insert_test_clock_controller_or_mux( find_fastest_clk_source ( clk_pin ))
insert_test_mode_mux_force (find_fastest_mux path( clk_pin ) )

the point of the first line is to find the actual clock source and make sure it can be muxed with the test_clk. If the thing found generates a clock, I believe the "mux" is called a test clock controller.

The point of the second line is to ensure that any muxes in the path to the ip's clock pin get their fastest input clock selected whenever the chips is in test_mode.

The algorithm runs at SoC creation time. At IP onboarding time, we need to know the mapping to test_mode and clockgate_en (and maybe resetbypass_en)

As for the SI and SO ports, if an IP has those pins, we need to explicitly know their widths. If what's passed in is a vector, that's not possible today. I think this is a good example of where a pararameter on the interface needs to exist to either control or convey the width of an interface signal

@fferhani
Copy link

@rpadler I think I need the clock and reset info in the scan insertion interface. Before stitching a flip-flop in a scan chain the scan insertion tool will check that its clock or reset input is directly connected to clock or reset input of the IP. So I need to specify an IP's clock and reset inputs to the scan insertion tool. If the IP is a hard macro I also need to specify those to a rule checker like Spyglass if I want to check that scan is properly inserted.

In addition, I also need the SoC stitcher to implement your algorithm to properly "wire up" the test clocks and resets at the SoC level.

@rpadler
Copy link
Contributor

rpadler commented Apr 23, 2020 via email

@fferhani
Copy link

fferhani commented Apr 23, 2020

Ah OK @rpadler so DUH would provide the list of clocks and resets to be used during test, but in another interface. You always try to use the same clocks and resets in functional and test modes, but sometimes it's not possible and you end up with clocks and resets you should only use in test mode and others you should only use in functional mode. How would DUH capture this information?

@rpadler
Copy link
Contributor

rpadler commented Apr 23, 2020 via email

@fferhani
Copy link

fferhani commented Apr 23, 2020

OK @rpadler. I think you are saying that even if a clock or reset is only to be used in test mode it still has to be specified in DUH through some clock/reset interface and it needs to be wired up properly at the SoC level. I agree. But look at case 3 in @drom Observable notebook: https://observablehq.com/@drom/scan-bus-definition . There are three clocks: pll, clk1, and clk2, but only one clk1 needs to be specified to the scan insertion tool. How would DUH capture that?

@rpadler
Copy link
Contributor

rpadler commented Apr 23, 2020 via email

@fferhani
Copy link

Actually @rpadler I think there might be a problem if during scan if we end up having more clocks than
necessarily running. I need to think more about this but I think it will make things unnecessarily complicated.

@drom
Copy link
Member Author

drom commented Apr 23, 2020

@rpadler

I don't agree that the scan interface should have clock or reset in it. First off it's not just 1 clock or reset. Instead for each clock/reset that is input to the IP you need
1.) the fastest clock source that is attached to the clock pin to be the muxable/overridable/controllable one
2.) any/all resets must be bypassable.

Thus, I believe the scan interface should just be mapping to the IPs, test_mode and clockgate_en signals. IT's not clear if there should also be a dedicated reset_bypass_en or if test_mode is always sufficient.

Here are some problems with using functional interfaces to capture SCAN information:

  • multiple functional interfaces can share the same clock. Should we provide SCAN information in every interface? or just one? is it optional?
  • We can't require that every functional interface busDefinition include a bunch of SCAN related signals. It is a significant overhead. Also, different people will be responsible on the functional interface and DFT.
  • Functional reset can be synchronous or asynchronous. SCAN reset is always asynchronous.

@drom
Copy link
Member Author

drom commented Apr 24, 2020

@rpadler You do need the full list of clocks and resets.

For SCAN, you don't need clocks that are not used in test_mode. You don't need resets that are not used in test_mode.

@drom
Copy link
Member Author

drom commented Apr 24, 2020

@rpadler

As for the SI and SO ports, if an IP has those pins, we need to explicitly know their widths. If what's passed in is a vector, that's not possible today. I think this is a good example of where a pararameter on the interface needs to exist to either control or convey the width of an interface signal

we know all component.model.port width that get referenced in component.busTinterfaces[*].portMap array. So we know the width.

@rpadler
Copy link
Contributor

rpadler commented Apr 24, 2020 via email

@drom
Copy link
Member Author

drom commented Jul 6, 2020

AR for @rpadler to clear the interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants