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

dft: implementing interface to support different test modes #6533

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

Conversation

fgaray
Copy link
Contributor

@fgaray fgaray commented Jan 15, 2025

This is a refactoring change + public API change where we start supporting different tests modes. The test mode currently does nothing except for independendly architect and stitch each test mode.

In the future, different tests modes may have different types of scan (ex: internal scan, scan compression, boundary scan, etc) and may support to include/exclude cells in certain modes.

This is a refactoring change + public API change where we start
supporting different tests modes. The test mode currently does nothing
except for independendly architect and stitch each test mode.

In the future, different tests modes may have different types of scan
(ex: internal scan, scan compression, boundary scan, etc) and may
support to include/exclude cells in certain modes.

Signed-off-by: Felipe Garay <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Signed-off-by: Felipe Garay <[email protected]>
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@@ -9,6 +9,8 @@ link_design sub_modules

create_clock -name main_clock -period 2.0000 -waveform {0.0000 1.0000} [get_ports {clock}]

set_dft_config -max_chains 1
Copy link
Member

Choose a reason for hiding this comment

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

This has no effect on the ok file and doesn't relate to test modes - what is the purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The user should always set at leaast a max_length or a chain_count. I added now some validation logic to force this.

Comment on lines +48 to +49
ScanArchitectConfig* getMutableScanArchitectConfig();
const ScanArchitectConfig& getScanArchitectConfig() const;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason one is by pointer and the other by reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to copy the protocol buffer's API were we explicitly need to use a mutable method to modify the objects:

Copy link
Member

Choose a reason for hiding this comment

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

Yes but why the difference in & vs * ?

Comment on lines 44 to 46
// Not copyable or movable.
TestModeConfig(const TestModeConfig&) = delete;
TestModeConfig& operator=(const TestModeConfig&) = delete;
Copy link
Member

Choose a reason for hiding this comment

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

You have no prevented moving, only copying.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here and everywhere else. I created a macro to prevent me to duplicate the correct constructors in all of my classes.

@@ -48,6 +48,8 @@ class ScanArchitectConfig
ClockMix // We architect the flops of different clock and edge together
};

ScanArchitectConfig() : clock_mixing_(ClockMixing::NoMix) {}
Copy link
Member

Choose a reason for hiding this comment

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

You can just do

ClockMixing clock_mixing_{NoMix};

and skip the ctor. Does this relate to test mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is related to the TestModeConfig as we need a default constructor if I am deleting the copy and move cosntructors.

Anyway, I changed this so we create a default ctor now.

if (name == kDefaultTestModeName) {
return createTestMode(name);
}
return nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

getOrDefaultMutableTestModeConfig sounds like it should return default if not found.

@maliberty
Copy link
Member

It would be nice to add a test with multiple test modes even if it doesn't do much yet.

Also, make it clear that we only support one test mode for now

Signed-off-by: Felipe Garay <[email protected]>
Signed-off-by: Felipe Garay <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

{
return scan_architect_config_;
if (test_modes_config_.size() >= 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]

Suggested change
if (test_modes_config_.size() >= 1) {
if (!test_modes_config_.empty()) {
Additional context

/usr/include/c++/11/bits/unordered_map.h:304: method 'unordered_map'::empty() defined here

      empty() const noexcept
      ^

Signed-off-by: Felipe Garay <[email protected]>
@fgaray
Copy link
Contributor Author

fgaray commented Feb 11, 2025

It would be nice to add a test with multiple test modes even if it doesn't do much yet.

There is not much to test now as I just wanted to finish the config hierarchy for other developers.

Test modes need more work to be implements. For one we need to add new ports to select the current active mode, ways to include/exclude cells in each test mode and add muxes in the scan chain signals depending on what cells are part of what test mode.

For sure more work than can be done in just one PR :)

I added an error message notifying that we don't currently support more than one test mode.

Signed-off-by: Felipe Garay <[email protected]>
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

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.

2 participants