mirror of
				https://github.com/cclassic/model-ghdl
				synced 2025-10-31 02:22:04 +01:00 
			
		
		
		
	Added memory for time sim length
This commit is contained in:
		
							parent
							
								
									6d3c712bec
								
							
						
					
					
						commit
						05a5172537
					
				| @ -41,6 +41,14 @@ string getSimulationTime() { // Very crude but works (for a proof-of-concept any | |||||||
|     vector < string > result; |     vector < string > result; | ||||||
|     string defaultValue = "100ns"; |     string defaultValue = "100ns"; | ||||||
| 
 | 
 | ||||||
|  |     ifstream myfile; | ||||||
|  |     char fileTemp[128]; | ||||||
|  |     myfile.open ("/tmp/ghdl-simtime"); | ||||||
|  |     myfile.getline(fileTemp, sizeof(fileTemp)); | ||||||
|  |     myfile.close(); | ||||||
|  |     if (string(fileTemp) != "") | ||||||
|  |         defaultValue = string(fileTemp); | ||||||
|  | 
 | ||||||
|     string temp = "zenity --entry --text \"Enter the duration:\" --title \"Simulation time\" --entry-text=\"" + defaultValue + "\""; |     string temp = "zenity --entry --text \"Enter the duration:\" --title \"Simulation time\" --entry-text=\"" + defaultValue + "\""; | ||||||
|     proc = popen(temp.c_str(), "r"); |     proc = popen(temp.c_str(), "r"); | ||||||
| 
 | 
 | ||||||
| @ -65,8 +73,14 @@ string getSimulationTime() { // Very crude but works (for a proof-of-concept any | |||||||
|     if (pclose(proc)) { |     if (pclose(proc)) { | ||||||
|         defaultValue = ""; |         defaultValue = ""; | ||||||
|     } |     } | ||||||
|  |     else { | ||||||
|  |         ofstream myfile; | ||||||
|  |         myfile.open ("/tmp/ghdl-simtime"); | ||||||
|  |         myfile << defaultValue; | ||||||
|  |         myfile.flush(); | ||||||
|  |         myfile.close(); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     cout << "TIM=" << defaultValue << endl; |  | ||||||
|     return defaultValue; |     return defaultValue; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user