FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-25-2006, 06:05 PM
Weng Tianxiang
Guest
 
Posts: n/a
Default How to open a document whose name is generated based on the current date and time

Hi,
I would like to copy several segments of code in VHDL:
1. Open a document whose name is generated based on the current date
and time;
2. Write data array into it;
3. Close it.

If you know, please give a tip.

Thank you.

Weng

Reply With Quote
  #2 (permalink)  
Old 09-25-2006, 06:14 PM
David Ashley
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the currentdate and time

Weng Tianxiang wrote:
> Hi,
> I would like to copy several segments of code in VHDL:
> 1. Open a document whose name is generated based on the current date
> and time;
> 2. Write data array into it;
> 3. Close it.
>
> If you know, please give a tip.
>
> Thank you.
>
> Weng
>


Perhaps have a where script you run the simulator,
output the file to a known fixed name, then in the
script rename the file to the data-based filename
you'd like?

Pass the output filename in as an argument to
the simulator? Not that I know how to do this...

-Dave

--
David Ashley http://www.xdr.com/dash
Embedded linux, device drivers, system architecture
Reply With Quote
  #3 (permalink)  
Old 09-25-2006, 07:12 PM
Weng Tianxiang
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the current date and time


David Ashley wrote:
> Weng Tianxiang wrote:
> > Hi,
> > I would like to copy several segments of code in VHDL:
> > 1. Open a document whose name is generated based on the current date
> > and time;
> > 2. Write data array into it;
> > 3. Close it.
> >
> > If you know, please give a tip.
> >
> > Thank you.
> >
> > Weng
> >

>
> Perhaps have a where script you run the simulator,
> output the file to a known fixed name, then in the
> script rename the file to the data-based filename
> you'd like?
>
> Pass the output filename in as an argument to
> the simulator? Not that I know how to do this...
>
> -Dave
>
> --
> David Ashley http://www.xdr.com/dash
> Embedded linux, device drivers, system architecture


Hi David,
Good advice!

I am using Window XP system and run ModelSim simulator.

Please let me know what script software can be used and your
recommendation.

I would like to learn to write scripts under ModelSim simulation
environment.

Can you give some examples to let me start easier.

Weng

Reply With Quote
  #4 (permalink)  
Old 09-25-2006, 07:19 PM
David Ashley
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the currentdate and time

Weng Tianxiang wrote:
> David Ashley wrote:
>
>>Weng Tianxiang wrote:
>>
>>>Hi,
>>>I would like to copy several segments of code in VHDL:
>>>1. Open a document whose name is generated based on the current date
>>>and time;
>>>2. Write data array into it;
>>>3. Close it.
>>>
>>>If you know, please give a tip.
>>>
>>>Thank you.
>>>
>>>Weng
>>>

>>
>>Perhaps have a where script you run the simulator,
>>output the file to a known fixed name, then in the
>>script rename the file to the data-based filename
>>you'd like?
>>
>>Pass the output filename in as an argument to
>>the simulator? Not that I know how to do this...
>>
>>-Dave
>>
>>--
>>David Ashley http://www.xdr.com/dash
>>Embedded linux, device drivers, system architecture

>
>
> Hi David,
> Good advice!
>
> I am using Window XP system and run ModelSim simulator.
>
> Please let me know what script software can be used and your
> recommendation.
>
> I would like to learn to write scripts under ModelSim simulation
> environment.
>
> Can you give some examples to let me start easier.
>
> Weng
>


Weng,

I use linux, it's inherently script friendly. However I think
you can use DOS .bat files and use '%' syntax. Perhaps
this page might help somehow:

http://www.ericphelps.com/batch/samp...sttime.bat.txt

-Dave


--
David Ashley http://www.xdr.com/dash
Embedded linux, device drivers, system architecture
Reply With Quote
  #5 (permalink)  
Old 09-26-2006, 02:37 PM
Brian Drummond
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the current date and time

On 25 Sep 2006 10:12:27 -0700, "Weng Tianxiang" <[email protected]>
wrote:

>I am using Window XP system and run ModelSim simulator.
>
>Please let me know what script software can be used and your
>recommendation.
>
>I would like to learn to write scripts under ModelSim simulation
>environment.



Under ModelSim, it is probably easiest to use TCL.

One option is to generate the filename (or even just the date/time) in
TCL, and pass it into the "Run" command as the value of a generic of
type String.

- Brian
Reply With Quote
  #6 (permalink)  
Old 09-26-2006, 07:55 PM
Weng Tianxiang
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the current date and time


Brian Drummond wrote:
> On 25 Sep 2006 10:12:27 -0700, "Weng Tianxiang" <[email protected]>
> wrote:
>
> >I am using Window XP system and run ModelSim simulator.
> >
> >Please let me know what script software can be used and your
> >recommendation.
> >
> >I would like to learn to write scripts under ModelSim simulation
> >environment.

>
>
> Under ModelSim, it is probably easiest to use TCL.
>
> One option is to generate the filename (or even just the date/time) in
> TCL, and pass it into the "Run" command as the value of a generic of
> type String.
>
> - Brian


Hi Brian and David,
Could you please give some examples on the coding or the reference to
the manual on how to do it?

Thank you.

Weng

Reply With Quote
  #7 (permalink)  
Old 09-26-2006, 10:48 PM
Jonathan Bromley
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the current date and time

On 26 Sep 2006 10:55:58 -0700, "Weng Tianxiang"
<[email protected]> wrote:

>Could you please give some examples on the coding or the reference to
>the manual on how to do it?


hi Weng

What do you want to do? (Sorry, I missed the first
part of this thread somehow.) If you want to create
an output file, something like this...

# Put this into a .do file and source it into ModelSim
proc filename_from_date {prefix} {
set t [clock seconds]
append prefix [clock format $t -format "%Y-%m-%d_%H-%M"]
return $prefix
}
########################################

Now, when you type the command

filename_from_date Report_File_

you will get a result like

Report_File_2006-09-21_21-45

And you can use this result as the name of a file to open in Tcl...

set file_handle [open [filename_from_date Report_File_] w]
puts $file_handle "This is line 1 of the file"
puts $file_handle "This is line 2"
close $file_handle

Is this anything like what you need?????
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
[email protected]
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.


Reply With Quote
  #8 (permalink)  
Old 09-27-2006, 05:28 PM
Weng Tianxiang
Guest
 
Posts: n/a
Default Re: How to open a document whose name is generated based on the current date and time


Jonathan Bromley wrote:
> On 26 Sep 2006 10:55:58 -0700, "Weng Tianxiang"
> <[email protected]> wrote:
>
> >Could you please give some examples on the coding or the reference to
> >the manual on how to do it?

>
> hi Weng
>
> What do you want to do? (Sorry, I missed the first
> part of this thread somehow.) If you want to create
> an output file, something like this...
>
> # Put this into a .do file and source it into ModelSim
> proc filename_from_date {prefix} {
> set t [clock seconds]
> append prefix [clock format $t -format "%Y-%m-%d_%H-%M"]
> return $prefix
> }
> ########################################
>
> Now, when you type the command
>
> filename_from_date Report_File_
>
> you will get a result like
>
> Report_File_2006-09-21_21-45
>
> And you can use this result as the name of a file to open in Tcl...
>
> set file_handle [open [filename_from_date Report_File_] w]
> puts $file_handle "This is line 1 of the file"
> puts $file_handle "This is line 2"
> close $file_handle
>
> Is this anything like what you need?????
> --
> Jonathan Bromley, Consultant
>
> DOULOS - Developing Design Know-how
> VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
>
> Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
> [email protected]
> http://www.MYCOMPANY.com
>
> The contents of this message may contain personal views which
> are not the views of Doulos Ltd., unless specifically stated.


Hi Jonathan,
What I want to do is:
During ModelSim simulations, I want to generate two files:
Each time when I start running the simulations, it will do:
1. Put input data into an input file named after date and time;
2. Put output data into an output file named with input data file
appended with
a string "-out".

Input and output data are known to the vhdl file or to the wave.do
file.

My working operating system is Window XP.

I don't know Tcl language and I would like to learn it if necessary;

I am familiar with C and C++.

This is my plan to do it:
1. Transfer input and output data into ASCII string using VHDL
language;
2. Using vhdl procedures ieee.TEXTIO.all to write ASCII strings into a
created file
3. Using C language to do other things with the two files and generate
report.

Any advices?

Thank you.

Weng

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sun open SPARC micro architecture document Davy VHDL 1 03-12-2008 05:37 AM
Sun open SPARC micro architecture document Davy FPGA 1 03-12-2008 05:37 AM
Sun open SPARC micro architecture document Davy Verilog 1 03-12-2008 05:37 AM
Date/Time Niv VHDL 2 09-09-2004 08:58 PM
Using Verilog to embed the synthesis date and time John Providenza FPGA 6 07-21-2004 09:29 PM


All times are GMT +1. The time now is 02:17 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved