I have written a code to read file below but its not working. Input file:
2 1 16 16 0 0 1 1 1234 16 0 0 1 1 2345 code is:
std::ifstream input_file; evl_wire wire; int num_pins,width,cycles,no; std::vector<int>IP; while(input_file) { input_file >> num_pins;//num_pins=2 if (pins_.size() != num_pins) return false; for (size_t i = 0; i < pins_.size(); ++i) { input_file >> width;//width=1 for 1=0 ,=16 for i=2 if (wire.width != width) return false; pins_[i]->set_as_output(); } for (size_t i = 1; i < file_name.size(); i=i+1) input_file>>cycles; input_file>>no; pins_=IP; } where std::vector<pin *> pins_; is in gate class and void set_as_output(); is in pin class 2 represent no of pins,1 width of first pin and 16 width of second pin. here from second line in file 16 is no of cycles pins must remain at 0 0,for next 1 cycle pins must be assigned 1 and 1234 as inputs.