以下のファイルを読み取るコードを書きましたが、機能しません。入力ファイル:
2 1 16
16 0 0
1 1 1234
16 0 0
1 1 2345
コードは次のとおりです。
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;
}
ここstd::vector<pin *> pins_;
で、 はゲート クラスvoid set_as_output();
、ピン クラス 2 はピン数を表し、1 番目のピンの幅は 1、2 番目のピンの幅は 16 です。ここで、ファイル 16 の 2 行目からは、ピンが 0 のままでなければならないサイクル数です。次の 1 サイクルでは、ピンに 1 と 1234 を入力として割り当てる必要があります。