in reply to Reading block
From this what i have to do is,i have to read input,output,always,and initial blocks and have to send them seperate files ie input to input_in,output_out,always to alway_all;input [31:0] ucast_mem_wdata; input [31:0] ucast_mem_wren; input ucast_mem_wr; input ucast_mem_rd; output [31:0] ucast_mem_rdata; wire [BMU_MEM_ADDR_BITS-1:0] mem_addr; always @ (posedge sys_clk +or negedge sys_reset_n) begin if (!sys_reset_n) ucast_int_mem_rd_r <= 0; else ucast_int_mem_rd_r <= ucast_int_mem_rd & !ucast_access; end endmodule
I am having the pblm at reading always block as it is so many internal blocks
could u anybody tell me how to read entire always block and write it to the socalled named file THis is the code I tried for input and out put reading
but i couldnt get any idea regarding the reading of whole always blcok for the above
your attempt from ravi030's scratchpad
#!usr/bin/perl use strict; use warnings; open( my $ip_fileh, '<', "D:\\PacketProcessor\\rtl\\common\\gen_sync_fifo.v" ) || die ( "unable to open the file D:\\PacketProcessor\\rtl\\common\\gen_sync_fifo.v\n" ); #open the file while (<$ip_fileh>) { #read the file line by line my $str = $_; #assign to a variable chomp $str; #remove the new line if ( $str =~ m/(Input|output) ((\w+(,\s*\w+)*)|([^\n]*))/i ) { my $type = $1; #get whether input or output my @inp_vals = split /\,\s*/, $2; #split by comma followed +by space if more than one values local $" = "\n"; #to print the array values line by line print "$type\n@inp_vals \n"; #print the output } } __END__
|
|---|