0

I am converting a TCL script to perl.

I have tried it using the system command and back tics. I am executing the perl script in primetime in the following way, exec script.pl. The script contains many commands including the following command.

my $val = `sizeof_collection [get_pins -quiet -filter "is_hierarchical == true"]`;

The shell throws an error like sizeof_collection: command not found.

6
  • 3
    Perl backticks use sh to run a command. sh does not understand tcl... Commented Aug 20, 2024 at 6:55
  • That looks like a few commands implemented by the synthesis environment and only exported to Tcl. They're not exported to the shell or to Perl (or even to a standard tclsh; properly application-specific) so porting the script is going to be... very challenging at best. Commented Aug 20, 2024 at 6:56
  • I think sizeof_collection is a PrimeTime command and cannot be executed directly from the shell (via perl). You need to create a TCL script to run that command in primetime. For example from Perl you can call primetime like this: my $val = `primetime -file temp_script.tcl`; Commented Aug 20, 2024 at 20:39
  • Can you please explain why you're doing this??? It sounds like you are starting with a Tcl script, which already runs in primetime's Tcl interface. Why would you want to convert that to Perl and yet still want to run it in primetime? If you want to change to Perl because you think it will run faster than Tcl, then you probably should have asked how to make your Tcl run faster. If you want to change to Perl because you know Perl better than Tcl, that's a bad reason. In VLSI work, Tcl is much more useful to know that Perl. Commented Aug 24, 2024 at 11:32
  • @ChrisHeithoff i want to integrate this script to a larger perl script. if this is not advisable. can you please tell me how to execute this tcl script through perl. Commented Aug 26, 2024 at 15:58

1 Answer 1

1

On the surface, the translation is (using a truth-y value for quiet):

my $val = sizeof_collection(get_pins(quiet=>1, filter=>"is_hierarchical == true"));

That's the surface though; you then run straight into the problem of "what are the sizeof_collection and get_pins subroutines?" The problem there is that they're implemented by an augmented Tcl runtime (they're application-apecific extensions) and the augmentation is rather a large application written in C (or C++). Porting that is... a big task.

To be fair, sizeof_collection is probably nearly trivial. But get_pins is not; it's obviously applying a filter to select things from an underlying data model and that suddenly means you're dealing with a large fraction of the application core...

See also:

Sign up to request clarification or add additional context in comments.

1 Comment

Looking for a citation for what get_pins does and there are multiple incompatible ones depending on which toolchain is in use, at least going by the docs. "Fun!"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.