Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. std::vector<std::string> maskedVLIW(std::vector<std::string> instructions)
  2. {
  3. std::vector<std::string> encodedVLIW;
  4. std::int16_t width = instWidth(instructions);
  5.  
  6. for (std::vector<int>::size_type i = 0; i != instructions.size(); i++){
  7. // utilities per line
  8.  
  9. std::regex regex("c0\s+(.*)")
  10. std::string mask = "";
  11. std::string instructions = "";
  12. std::string line;
  13.  
  14. if instructions[i].find("NOP"){
  15. mask += "0";
  16. }
  17. else {
  18. mask += "1";
  19. // TODO parse this
  20. instructions += instructions[i];
  21. }
  22. if (instructions[i].find(";;") == 0){
  23. string = "";
  24. instructions = "";
  25. line = "c0\t" + mask + "\t" + instructions + "\n";
  26. encodedVLIW.push_back(line);
  27.  
  28. }
  29. }
  30.  
  31. return encodedVLIW;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement