You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. We encounter scalability issue when we try to use essent to compile the MinimalConfig of XiangShan (a complicated open-source high performance RISC-V processor). We use a low firrtl file as the input of essent. But the size of the low firrtl file is 140MB, and it contains about 1.5 million lines. This low firrtl file is attached in the zip file at the end of this post. It takes about 13 hours for essent to generate a header file on a server with i9-9900k and 64GB memory.
To profile essent, we use option -ell Debug -fll Debug and save the log into essent.log, which is also attached. We find that the small step took about 11 hours.
Besides, the size of the generated header file is 688MB, and it contains about 5.5 million lines. This huge header file is also attached. It takes days for g++ to compile this huge header file.
Note that the MinimalConfig of XiangShan is dual-issue. But the DefaultConfig of XiangShan is six-issue and the design is much more complicated. Before we try DefaultConfig with essent, we think that we must address the scalability issue of essent.
Below are some suggestions.
From firrtl to .h: We are not familiar with the internal of essent. We hope that the log file attached can help you to analyze the performance.
From .h to elf:
To enable parallel compilation of g++, we write a python script to split the huge header file into multiple source files. We only keep the class definition in the header file, and move all constructors and functions into source files. Currently there are no more than 100 functions in a source file. The python script splits the huge header file into about 300 source files. We think that essent can support such file splitting feature, with the file granularity configurable by user.
But it still takes about 2.5 hours for g++ to compile a single split source file with size 2MB. After profiling g++, we find that g++ spends 98% of the time to parse struct body, among of which 80% of the time is cost for name lookup. This is because there are 0.4 million member variables in the class definition of the top module. However, users do not care about the name of these variables. One suggestion is to merge all variables into a big vector. Then essent allocates and manipulates each individual signal in this big vector. To keep readability, essent can generate comments to record the original semantics of signal allocation and manipulation. For example,
// defined in the struct
UInt<1000000> all_signals;
/* 2: cache_real_hit
4: valid
5: hit
...
*/
// in the function body
all_signals(2) = all_signals(4) & all_signals(5); // cache_real_hit = valid & hit;
It takes less than 10 minutes for clang++ to compile splitted source files, and the cost is acceptable. But long time for essent to compile remains a problem.
Hi. We encounter scalability issue when we try to use
essent
to compile theMinimalConfig
of XiangShan (a complicated open-source high performance RISC-V processor). We use a low firrtl file as the input ofessent
. But the size of the low firrtl file is 140MB, and it contains about 1.5 million lines. This low firrtl file is attached in the zip file at the end of this post. It takes about 13 hours foressent
to generate a header file on a server with i9-9900k and 64GB memory.To profile
essent
, we use option-ell Debug -fll Debug
and save the log intoessent.log
, which is also attached. We find that thesmall
step took about 11 hours.Besides, the size of the generated header file is 688MB, and it contains about 5.5 million lines. This huge header file is also attached. It takes days for
g++
to compile this huge header file.Note that the
MinimalConfig
of XiangShan is dual-issue. But theDefaultConfig
of XiangShan is six-issue and the design is much more complicated. Before we tryDefaultConfig
withessent
, we think that we must address the scalability issue ofessent
.Below are some suggestions.
From firrtl to .h: We are not familiar with the internal of
essent
. We hope that the log file attached can help you to analyze the performance.From .h to elf:
g++
, we write a python script to split the huge header file into multiple source files. We only keep the class definition in the header file, and move all constructors and functions into source files. Currently there are no more than 100 functions in a source file. The python script splits the huge header file into about 300 source files. We think thatessent
can support such file splitting feature, with the file granularity configurable by user.g++
to compile a single split source file with size 2MB. After profilingg++
, we find thatg++
spends 98% of the time to parse struct body, among of which 80% of the time is cost for name lookup. This is because there are 0.4 million member variables in the class definition of the top module. However, users do not care about the name of these variables. One suggestion is to merge all variables into a big vector. Thenessent
allocates and manipulates each individual signal in this big vector. To keep readability,essent
can generate comments to record the original semantics of signal allocation and manipulation. For example,essent-XiangShan.zip
The text was updated successfully, but these errors were encountered: