Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • 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 cooling their heels in the Monastery: (3)
    As of 2025-06-15 14:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.