Merge branch 'master' of github.com:lnis-uofu/OpenFPGA into xt_fabric_tile
This commit is contained in:
commit
7783229d90
|
@ -2,7 +2,7 @@ FROM ghcr.io/lnis-uofu/openfpga-master:8d555772
|
|||
|
||||
# Install node js
|
||||
USER root
|
||||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
|
||||
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
|
||||
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
||||
RUN apt-get install -y nodejs
|
||||
RUN apt-get install tree
|
||||
|
@ -49,7 +49,7 @@ RUN python3 -m pip install --upgrade pip
|
|||
RUN python3 -m pip install --user --no-cache-dir notebook
|
||||
RUN python3 -m pip install --user --no-cache-dir jupyterlab
|
||||
RUN python3 -m pip install --user --no-cache-dir jupyterhub
|
||||
RUN python3 -m pip install --user --no-cache-dir "jupyter-server<2.0.0"
|
||||
RUN python3 -m pip install --user --no-cache-dir jupyter-server
|
||||
RUN python3 -m pip install --user --no-cache-dir jupyter-server-proxy
|
||||
RUN python3 -m pip install --user --no-cache-dir jupyter-vscode-proxy
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.2.1200
|
||||
1.2.1214
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* This file includes functions that are used to decode integer to binary
|
||||
*vectors or the reverse operation
|
||||
***************************************************************************************/
|
||||
#include <cmath>
|
||||
|
||||
/* Headers from vtrutil library */
|
||||
#include "openfpga_decode.h"
|
||||
|
||||
#include "vtr_assert.h"
|
||||
|
||||
/* begin namespace openfpga */
|
||||
|
@ -109,12 +109,28 @@ std::string combine_two_1hot_str(const std::string& code1,
|
|||
* Output:
|
||||
* index | 0 | 1 | 2
|
||||
* ret | 0 | 0 | 1
|
||||
*
|
||||
* ToDo: Need to revisit and change all the feature that call to this function
|
||||
* Had studied the code, should be safe to make the change
|
||||
* Apparently we only want to store 0 or 1 (binary vector)
|
||||
* Yet we store it in a vector on size_t (8 Bytes)
|
||||
* We are using 8x memory that we supposed to
|
||||
* uint8_t is good enough
|
||||
* Not a bug, but is a serious unoptimized issue
|
||||
********************************************************************/
|
||||
std::vector<size_t> itobin_vec(const size_t& in_int, const size_t& bin_len) {
|
||||
/* bin_len must be in valid range*/
|
||||
VTR_ASSERT(bin_len > 0 && bin_len <= 64);
|
||||
std::vector<size_t> ret(bin_len, 0);
|
||||
|
||||
/* Make sure we do not have any overflow! */
|
||||
VTR_ASSERT((in_int < pow(2., bin_len)));
|
||||
/* If the length is 64 bits, in_int can be any number since this is the max
|
||||
bit length, and BTW pow(2, 64) itself should be zero (from 64bits size_t
|
||||
perspective). Once we fix the bintoi_charvec() bug, without this change, it
|
||||
will cause assertion */
|
||||
if (bin_len < 64) {
|
||||
VTR_ASSERT(in_int < (size_t(1) << bin_len));
|
||||
}
|
||||
|
||||
size_t temp = in_int;
|
||||
for (size_t i = 0; i < bin_len; i++) {
|
||||
|
@ -140,10 +156,18 @@ std::vector<size_t> itobin_vec(const size_t& in_int, const size_t& bin_len) {
|
|||
* which has a smaller memory footprint than size_t
|
||||
********************************************************************/
|
||||
std::vector<char> itobin_charvec(const size_t& in_int, const size_t& bin_len) {
|
||||
/* bin_len must be in valid range*/
|
||||
VTR_ASSERT(bin_len > 0 && bin_len <= 64);
|
||||
std::vector<char> ret(bin_len, '0');
|
||||
|
||||
/* Make sure we do not have any overflow! */
|
||||
VTR_ASSERT((in_int < pow(2., bin_len)));
|
||||
/* If the length is 64 bits, in_int can be any number since this is the max
|
||||
bit length, and BTW pow(2, 64) itself should be zero (from 64bits size_t
|
||||
perspective). Once we fix the bintoi_charvec() bug, without this change, it
|
||||
will cause assertion */
|
||||
if (bin_len < 64) {
|
||||
VTR_ASSERT(in_int < (size_t(1) << bin_len));
|
||||
}
|
||||
|
||||
size_t temp = in_int;
|
||||
for (size_t i = 0; i < bin_len; i++) {
|
||||
|
@ -170,11 +194,14 @@ std::vector<char> itobin_charvec(const size_t& in_int, const size_t& bin_len) {
|
|||
* which has a smaller memory footprint than size_t
|
||||
********************************************************************/
|
||||
size_t bintoi_charvec(const std::vector<char>& bin) {
|
||||
/* bin.size() must be in valid range*/
|
||||
VTR_ASSERT(bin.size() > 0 && bin.size() <= 64);
|
||||
|
||||
size_t ret = 0;
|
||||
|
||||
for (size_t i = 0; i < bin.size(); ++i) {
|
||||
if ('1' == bin[i]) {
|
||||
ret += pow(2., i);
|
||||
ret |= ((size_t)(1) << i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
yosys
2
yosys
|
@ -1 +1 @@
|
|||
Subproject commit 14d50a176d59a5eac95a57a01f9e933297251d5b
|
||||
Subproject commit d5d2bf815ae73cd9e003196e0b880e98b42caa1a
|
Loading…
Reference in New Issue