Hi Monk,
I have a file of the following content and structure:
===============================================
// 1st commented line
//second commented line
// timescale 1ns /5 ns
timescale 1ns/4ns //this comment should also be ignored
module modulename1 (a b c )
some lines....
some lines ...
//third commented line
//fourth commented line
timescale 3ns/5ns
module modulename2 (p q r)
some lines ...
//fifth comment
//timescale 4ns/5ns
timescale 1ns/3ns
module modulename3 (m n p )
some line ...
================================================
In this above file structure '//' is used for commenting a line which will be ignored for parsing. I need to parse this above file so that I can extract the timescale value
corresponding to each modulename.
For example, modulename1 has 1ns/5ns as its timescale, modulename2 has 3ns/5ns and so on.
Also the comments after the timescale value will be ignored as mentioned above.
The problem being is the timescale value for a particular module is appearing above the module declaration in the file. Please help me in getting the timescale value corresponding to each modulename.
Thanks.