Skip to content
Browse files

Output to file

  • Loading branch information...
1 parent ca63e44 commit fe988520ebc80cd74464dadd59eb1f87ade56196 @unregistered unregistered committed Apr 19, 2012
Showing with 19 additions and 3 deletions.
  1. +3 −0 Makefile
  2. +16 −3 gatesim.cpp
View
3 Makefile
@@ -14,6 +14,9 @@ test_binary: $(OBJECTS) tests.cpp
tests: test_binary
./tests
+
+valgrind: gatesim
+ valgrind --tool=memcheck --leak-check=yes ./gatesim
clean::
$(RM) $(BINARY)
View
19 gatesim.cpp
@@ -4,15 +4,28 @@
*/
#include "global.h"
#include <iostream>
+#include <fstream>
#include "parser.h"
+using namespace std;
+
+void dumpToFile(string filename, Design* aDesign)
+{
+ ofstream outfile(filename.c_str());
+
+ outfile.close();
+}
+
int main (int argc, char const *argv[])
{
LOG("Parsing and dumping test.v");
- Design *aDesign;
- aDesign = parseThatShit("test.v");
+ Design *a;
+ a = parseThatShit("test.v");
+ dumpToFile("test.v.out", a);
LOG("Parsing and dumping test2.v");
- aDesign = parseThatShit("test2.v");
+ a = parseThatShit("test2.v");
+ dumpToFile("test2.v.out", a);
+
return 0;
}

0 comments on commit fe98852

Please sign in to comment.
Something went wrong with that request. Please try again.