Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.14 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cd /tmp
  4.  
  5. # Yosys
  6.  
  7. sudo apt install -y build-essential clang bison flex \
  8.     libreadline-dev gawk tcl-dev libffi-dev git \
  9.     graphviz xdot pkg-config python3 libboost-system-dev \
  10.     libboost-python-dev libboost-filesystem-dev
  11.  
  12. git clone https://github.com/YosysHQ/yosys.git
  13. cd yosys
  14. make config-gcc
  15. make -j4
  16. sudo make install
  17. cd ..
  18.  
  19. # IceStorm
  20.  
  21. sudo apt install -y build-essential clang bison flex libreadline-dev \
  22.                      gawk tcl-dev libffi-dev git mercurial graphviz   \
  23.                      xdot pkg-config python python3 libftdi-dev \
  24.                      qt5-default python3-dev libboost-all-dev cmake
  25.  
  26. git clone https://github.com/cliffordwolf/icestorm.git icestorm
  27. cd icestorm
  28. make -j4
  29. sudo make install
  30. cd ..
  31.  
  32. # NextPNR
  33.  
  34. sudo apt install qt5-default libboost-dev libboost-filesystem-dev \
  35.     libboost-thread-dev libboost-program-options-dev \
  36.     libboost-python-dev libeigen3-dev
  37.  
  38. git clone https://github.com/YosysHQ/nextpnr.git
  39. cd nextpnr
  40.  
  41. # We need to hack out references to OpenGL 3.2
  42. git apply <<EOF
  43. diff --git a/3rdparty/qtimgui/ImGuiRenderer.cpp b/3rdparty/qtimgui/ImGuiRenderer.cpp
  44. index e77b47d..625ae7f 100644
  45. --- a/3rdparty/qtimgui/ImGuiRenderer.cpp
  46. +++ b/3rdparty/qtimgui/ImGuiRenderer.cpp
  47. @@ -39,8 +39,8 @@ QByteArray g_currentClipboardText;
  48.  void ImGuiRenderer::initialize(WindowWrapper *window) {
  49.      m_window.reset(window);
  50.      initializeOpenGLFunctions();
  51. -    g_fun = new QOpenGLFunctions_3_2_Core();
  52. -    g_fun->initializeOpenGLFunctions();
  53. +//    g_fun = new QOpenGLFunctions_3_2_Core();
  54. +//    g_fun->initializeOpenGLFunctions();
  55.  
  56.      ImGui::CreateContext();
  57.  
  58. @@ -117,7 +117,7 @@ void ImGuiRenderer::renderDrawList(ImDrawData *draw_data)
  59.      glUseProgram(g_ShaderHandle);
  60.      glUniform1i(g_AttribLocationTex, 0);
  61.      glUniformMatrix4fv(g_AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
  62. -    g_fun->glBindVertexArray(g_VaoHandle);
  63. +    //g_fun->glBindVertexArray(g_VaoHandle);
  64.  
  65.      for (int n = 0; n < draw_data->CmdListsCount; n++)
  66.      {
  67. @@ -151,7 +151,7 @@ void ImGuiRenderer::renderDrawList(ImDrawData *draw_data)
  68.      glUseProgram(last_program);
  69.      glBindTexture(GL_TEXTURE_2D, last_texture);
  70.      glActiveTexture(last_active_texture);
  71. -    g_fun->glBindVertexArray(last_vertex_array);
  72. +    //g_fun->glBindVertexArray(last_vertex_array);
  73.      glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
  74.      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, last_element_array_buffer);
  75.      glBlendEquationSeparate(last_blend_equation_rgb, last_blend_equation_alpha);
  76. @@ -244,8 +244,8 @@ bool ImGuiRenderer::createDeviceObjects()
  77.      glGenBuffers(1, &g_VboHandle);
  78.      glGenBuffers(1, &g_ElementsHandle);
  79.  
  80. -    g_fun->glGenVertexArrays(1, &g_VaoHandle);
  81. -    g_fun->glBindVertexArray(g_VaoHandle);
  82. +    //g_fun->glGenVertexArrays(1, &g_VaoHandle);
  83. +    //g_fun->glBindVertexArray(g_VaoHandle);
  84.      glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
  85.      glEnableVertexAttribArray(g_AttribLocationPosition);
  86.      glEnableVertexAttribArray(g_AttribLocationUV);
  87. @@ -262,7 +262,7 @@ bool ImGuiRenderer::createDeviceObjects()
  88.      // Restore modified GL state
  89.      glBindTexture(GL_TEXTURE_2D, last_texture);
  90.      glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
  91. -    g_fun->glBindVertexArray(last_vertex_array);
  92. +    //g_fun->glBindVertexArray(last_vertex_array);
  93.  
  94.      return true;
  95.  }
  96. diff --git a/3rdparty/qtimgui/ImGuiRenderer.h b/3rdparty/qtimgui/ImGuiRenderer.h
  97. index 8962c07..9147991 100644
  98. --- a/3rdparty/qtimgui/ImGuiRenderer.h
  99. +++ b/3rdparty/qtimgui/ImGuiRenderer.h
  100. @@ -54,7 +54,7 @@ private:
  101.      int          g_AttribLocationTex = 0, g_AttribLocationProjMtx = 0;
  102.      int          g_AttribLocationPosition = 0, g_AttribLocationUV = 0, g_AttribLocationColor = 0;
  103.      unsigned int g_VboHandle = 0, g_VaoHandle = 0, g_ElementsHandle = 0;
  104. -    QOpenGLFunctions_3_2_Core *g_fun = nullptr;
  105. +//    QOpenGLFunctions_3_2_Core *g_fun = nullptr;
  106.  };
  107.  
  108.  }
  109. EOF
  110.  
  111. cmake -DARCH=ice40 .
  112. make -j4
  113. sudo make install
  114. cd ..
  115.  
  116. # Build an example design :)
  117.  
  118. git clone https://github.com/Wren6991/RISCBoy.git riscboy
  119. cd riscboy
  120. source sourceme
  121. cd synth
  122. make -f HX8k-EVN.mk bit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement