Last change
on this file since 106 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
1.6 KB
|
Rev | Line | |
---|
[81] | 1 | #include "../include/TTY.h" |
---|
| 2 | #include <iostream> |
---|
| 3 | |
---|
| 4 | using namespace std; |
---|
| 5 | using namespace environment; |
---|
| 6 | using namespace environment::tty; |
---|
| 7 | |
---|
| 8 | #ifdef SYSTEMC |
---|
| 9 | int sc_main (int argc, char * argv[]) |
---|
| 10 | #else |
---|
| 11 | int main (int argc, char * argv[]) |
---|
| 12 | #endif |
---|
| 13 | { |
---|
| 14 | cout << "<main> Begin" << endl; |
---|
| 15 | |
---|
| 16 | uint32_t nb_tty = 4; |
---|
| 17 | string * name_tty = new string [nb_tty]; |
---|
| 18 | |
---|
| 19 | name_tty [0] = "tty_0"; |
---|
| 20 | name_tty [1] = "tty_1"; |
---|
| 21 | name_tty [2] = "tty_2"; |
---|
| 22 | name_tty [3] = "tty_3"; |
---|
| 23 | |
---|
| 24 | Parameters * param = new Parameters (nb_tty, |
---|
| 25 | name_tty, |
---|
| 26 | true); |
---|
| 27 | |
---|
| 28 | TTY * tty = new TTY ("my_tty", param); |
---|
| 29 | tty->reset(); |
---|
| 30 | |
---|
| 31 | cout << *tty << endl; |
---|
| 32 | |
---|
| 33 | char * message_0 = "Ici Londre : Adeline aime la saucisse de Frankort.\nJe repete : Adeline aime la saucisse de Frankort" ; |
---|
| 34 | char * message_1 = "Ici Londre : Maurice a garer le camion de bernard dans la cour.\nJe repete Maurice a garer le camion de bernard dans la cour"; |
---|
| 35 | char * message_2 = "Ici Londre : Londre est la ville qui diffuse des messages a la con.\nJe repete : Londre est la ville qui diffuse des messages a la con"; |
---|
| 36 | char * message_3 = "Ici Londre : Non, le debarquement n'aura pas lieu le 6 juin 1944 en Normandie, et je ne me repete pas"; |
---|
| 37 | |
---|
| 38 | char * message [nb_tty]; |
---|
| 39 | message[0] = message_0; |
---|
| 40 | message[1] = message_1; |
---|
| 41 | message[2] = message_2; |
---|
| 42 | message[3] = message_3; |
---|
| 43 | |
---|
| 44 | for (uint32_t j = 0; j < nb_tty ; j ++) |
---|
| 45 | { |
---|
| 46 | for (uint32_t i = 0; i < strlen(message[j]); i++) |
---|
| 47 | tty->write(j,message[j][i]); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | cout << "<main> Press <Enter> to stop the test" << endl; |
---|
| 51 | getchar(); |
---|
| 52 | |
---|
| 53 | delete tty; |
---|
| 54 | delete param; |
---|
| 55 | delete [] name_tty; |
---|
| 56 | cout << "<main> End" << endl; |
---|
| 57 | |
---|
| 58 | return EXIT_SUCCESS; |
---|
| 59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.