Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to preprocess sdc with perl

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use perl to preprocess sdc". In daily operation, I believe many people have doubts about how to use perl to preprocess sdc. The editor consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "how to use perl to preprocess sdc". Next, please follow the editor to study!

Background

Sometimes PD uses sdc written by integrated tools for PR and timing convergence. The synthesis tool will inevitably write sdc commands that are added specifically for synthesis. Therefore, the sdc must be processed before entering the PR phase.

For example:

Set_operating_condition

Set_max_area

Set_uncertainty

Set_max_transition

Set_clock_latency

......

The deletion or comments of these commands are usually done manually and are easy to miss. And usually because of the update iteration of sdc, these actions are repeated multiple times. This requires pre-processing the sdc with a script, we only need to maintain a script, and the sdc processing is done automatically.

Difficult point

Sdc uses the tcl syntax. For tcl, the end of a line does not mean the end of a line. Because tcl can escape newline characters through backslashes. This not only brings beauty, but also brings some difficulty to script processing.

Idea 1

One of the solutions is to delete all escaped newline characters first. The result is that all sdc commands occupy only one line. Then replace the sdc command.

The problem with this way of thinking is that sdc has changed beyond recognition. Rows do not correspond to rows at all, making it difficult for subsequent small iterations and debug.

Idea 2

In full accordance with the semantics of tcl, the file is re-divided, and the newline characters after transfer are excluded.

Here is the script after implementation:

#! / usr/bin/perlmy @ files = @ ARGV;my @ keywords = qw (set_max_areaset_max_fanouitset_ideal_networkset_timing_derateset_clock_latency)

Here are the keywords that need to be dealt with and can be modified according to the situation.

My $content;open my $fh, "

For my $line (@ lines) {my $prefix = "; for my word (@ keywords) {if (line = ~ / $word/) {prefix =" # ";}} print" prefix "." $line\ n "; at this point, the study on" how to preprocess sdc with perl "is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report