Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi all..

My original file FA.vhd is as follows...

component MAJ3 port( A : in std_logic := 'U'; enable : in std_logic; B : in std_logic := 'U'; C : in std_logic := 'U'; Y : out std_logic ); end component; signal \GND\, \VCC\, N_5, a_c, b_c, c_c, sum_c, GND_0, VCC_0 : std_logic; begin enable_pad : INBUF port map (PAD => enable, Y => enable_c);

i have one more file enabled_nets.txt that has follwoing lines..

a_e b_e c_e

i want to modify the signal declaration statement in FA.vhd as

signal \GND\, \VCC\, N_5, a_c, b_c, c_c, sum_c, GND_0, VCC_0, a_e, b_e, c_e, enable_c: std_logic;

i.e. i want to include the words in enabled_nets.txt to signal declaration part of FA.vhd as mentioned above, along with this i want to add one more signal enable_c also, and all these word need to be comma separated... Here is the perl script i have written for this... Correct the mistake in it monks.... Thank you all for your valuable time....

open (IN1, "<FA.vhd") or die; open (OUT, ">common_modify.vhd") or die; while (<IN1>) { print OUT; if (/signal/){ open (IN2, "<enabled_nets.txt") or die; my @enabled_nets = <IN2>; chomp @enabled_nets; while (<IN2>) { print OUT ; print OUT ',enable_c,'; } close (IN2); } } close (IN1); close (OUT);

In reply to How to insert a file with another file with comma separated?? by sumathigokul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found