Programming/Verilog2018. 4. 10. 20:58

'Programming > Verilog' 카테고리의 다른 글

verilog UDP  (0) 2018.04.16
Verilog initial  (1) 2018.04.12
Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
Posted by 구차니

예전에 적은게 있나 모르겠다만

그냥 생각나서 라즈베리에서 쳐보니까

기본으로 패키지 통합된 듯


pi@raspberrypi:~ $ python

Python 2.7.9 (default, Sep 17 2016, 20:26:04)

[GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> exit() 


pi@raspberrypi:~ $ pypy

Python 2.7.10 (4.0.1+dfsg-1+rpi1, Mar 07 2016, 10:36:18)

[PyPy 4.0.1 with GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>> exit() 


pi@raspberrypi:~ $ which python

/usr/bin/python

pi@raspberrypi:~ $ which pypy

/usr/bin/pypy

pi@raspberrypi:~ $ ll /usr/bin/pypy

lrwxrwxrwx 1 root root 22 Mar  8  2016 /usr/bin/pypy -> ../lib/pypy/bin/pypy-c

pi@raspberrypi:~ $ ll /usr/lib/pypy/bin

total 32604

drwxr-xr-x 2 root root     4096 Nov 26  2016 .

drwxr-xr-x 8 root root     4096 Nov 26  2016 ..

-rwxr-xr-x 1 root root 33374512 Mar  8  2016 pypy-c


'Programming > python(파이썬)' 카테고리의 다른 글

python + openGL  (0) 2019.04.30
python + openCV 공부 시작  (0) 2019.04.30
파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
Posted by 구차니
Programming/openCV2018. 3. 19. 10:38

각종 최적화랑 ASSERT 문으로 인해 속도 저하가 극심하니

릴리즈로 해라.. 정도?


[링크 : https://stackoverflow.com/.../opencv-slow-camera-framerate]

[링크 : https://stackoverflow.com/.../why-is-this-code-running-over-100-times-slower-in-debug-mode-than-release]

'Programming > openCV' 카테고리의 다른 글

opencv 원 추정  (0) 2019.01.16
OpenCV 분산처리  (0) 2018.04.25
openCV multicore support  (0) 2018.03.19
stitch / opencv / python  (0) 2016.07.18
opencv stitch  (0) 2016.07.14
Posted by 구차니
Programming/openCV2018. 3. 19. 10:38

openCV 2.4.6.1

intel TBB에서 openMP로 변환하여 라이브러리 빌드

[링크 : https://iamsrijon.wordpress.com/.../how-to-compile-opencv-to-utilize-multiple-core-processor-in-linux/]


라즈베리도 TBB에서 openMP로..

[링크 : https://stackoverflow.com/questions/28938644/opencv-multi-core-support]


openCV 3.4.1

얘도 머.. TBB

[링크 : https://docs.opencv.org/trunk/d7/dff/tutorial_how_to_use_OpenCV_parallel_for_.html]

'Programming > openCV' 카테고리의 다른 글

OpenCV 분산처리  (0) 2018.04.25
openCV release mode와 debug mode 속도 차이  (0) 2018.03.19
stitch / opencv / python  (0) 2016.07.18
opencv stitch  (0) 2016.07.14
opencv rtsp  (0) 2016.07.13
Posted by 구차니
Programming/Verilog2018. 3. 3. 13:34

#을 여러군데서 써서.. -_-

다른 의미를 지닌 같은 token이라니.. 언어 개발자를 때려주고 싶네!!!



1. DELAY

#는 delay의 용도로 쓰이는데, 단위는 ns이다

단위는 timescale에서 설정한 단위를 따른다.

+

2018.04.13

딜레이에는 세가지 설정이 가능하다

관성지연(inertial) - 캐피시턴스 특성 시뮬레이션, 프리미티브 게이트 전파지연 모델링에 사용

                       - # (rise, fall, turnoff) 세가지 값 설정가능

전달지연(transport = net) - 전기가 전달되는 속도 한계로 인한 시간 지연 시뮬레이션

정규지연(regular) - ???

[링크 : https://blog.naver.com/beahey/90166877125]

[링크 : http://content.inflibnet.ac.in/.../33-7-LM-V1-S1__delay_modeling.pdf]


Explicit Time Delay

#5 // dealy 5ns

# 10; // wait 10 ns;


Explicit Propagation Delay

w <= #4 a ^ b;

x <= #5 b | c; 

[링크 : http://ee.usc.edu/~redekopp/ee457/slides/EE457Unit1b_VerilogDiscussion.pdf]


2. 모듈 초기화 인자

[링크 : http://home.mit.bme.hu/~rtamas/DigitalDesign2/Verilog_Intro_part1_print4.pdf]


module-name #(parameter-assignment) instance-name (module-terminal-list) ; 


[링크 : https://electronics.stackexchange.com/.../how-do-i-define-a-module-with-a-modified-parameter-in-verilog]

'Programming > Verilog' 카테고리의 다른 글

Verilog initial  (1) 2018.04.12
Verilog =, ==, ===  (0) 2018.04.10
encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
verliog module 선언  (0) 2018.01.25
Posted by 구차니

잘 되는건지 모르겠지만

주석풀어주면 빌드도 안되는 망할(!) TMS320F2808 예제에서

프로젝트로 확인해보니

//#include <stdio.h>


/*

 * hello.c

 */

int main(void) {

// printf("Hello World!\n");

return 0;


MISRA-C:2004를 지원을 하지만 설정된 체크방법이 하나도 없어서 별다른 에러나 경고가 없는데

귀찮으니 "All" 누르고 다시 컴파일 하면


이런식으로 경고에 MISRA-C:2004 라고 표기되며 나타난다.

간이(?)로 쓰기에는 어떨려나 모르겠네..


CCS v6 까지는 무료로 풀렸으니, 빌드 가능한 녀석이라면 이걸로 간이 체크하는 정도로는 쓸 수 있을지도?

Posted by 구차니
Programming/Verilog2018. 2. 3. 11:43

QSYS 데모 프로젝트에 CPU.v 가 보여서 열어보려고 했더니 배째네


아무튼.. 해당경로에서 뒤져보니.. 음.. 일단 정체 불명의 바이너리로 보인다.


표준으로 제정되어 IP 보호를 위해 암호화를 지원하고

IEEE Std 1735-2014 (Incorporates IEEE Std 1735-2014/Cor 1-2015) - IEEE Recommended Practice for Encryption and Management of Electronic Design Intellectual Property (IP)

[링크 : https://standards.ieee.org/findstds/standard/1735-2014.html]

    [링크 : http://www.edaboard.com/thread276606.html]

[링크 : http://www.eda-twiki.org/twiki/pub/P10761/WorkingGroupDocuments/P1735_Overview_4spp.pdf]


요 근래에 보안이 깨진 듯 하다

일단 내부적으로는 AES 암호화를 사용하는 것으로 보이고 AES-CBC Mode라는걸 사용하나 보다

[링크 : http://news.grayhash.com/category/vulnerability/IEEE_P1735]


'Programming > Verilog' 카테고리의 다른 글

Verilog =, ==, ===  (0) 2018.04.10
Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
verilog module instantiate  (0) 2018.01.26
verliog module 선언  (0) 2018.01.25
verilog 모델링 유형  (0) 2018.01.20
Posted by 구차니
Programming/C Win32 MFC2018. 1. 31. 12:12

간단하게

const char*는 const char 를 가르키는 포인터 이고

포인터가 가리키는 변수를 다른걸로 바꿀 수 있지만

포인터가 가리키는 변수의 내용은 바꿀 수 없다.


char * const는 char를 가리키는 const 포인터 이고

포인터가 가리키는 변수를 다른걸로 바꿀 수 없지만

포인터가 가리키는 변수의 내용을 바꿀순 있다.


근데.. const 포인터를 어따 써먹지?

링크드 리스트 이런거 구현하거나 범용적으로 쓰이려면 쓸데도 없고

C++의 레퍼런스 처럼 특정 변수를 지정해서 쓰는 용도라면..

커널내에서 정도 밖에 떠오르지 않네?


char * const a;

means that the pointer is constant and immutable but the pointed data is not.

You could use const_cast(in C++) or c-style cast to cast away the constness in this case as data itself is not constant.


const char * a;

means that the pointed data cannot be written to using the pointer a. Using a const_cast(C++) or c-style cast to cast away the constness in this case causes Undefined Behavior. 

[링크 : https://stackoverflow.com/questions/10091825/constant-pointer-vs-pointer-on-a-constant-value4]

[링크 : http://ra2kstar.tistory.com/143]

'Programming > C Win32 MFC' 카테고리의 다른 글

uuid in c  (0) 2018.10.22
엔디안 급 멘붕..  (0) 2018.05.29
소스 코드 포맷 적용하기  (0) 2018.01.08
win32 시리얼 통신 LPCTSTR / LPCSTR  (0) 2017.12.07
MFC CList 선택항목 인덱스 얻기  (0) 2017.11.28
Posted by 구차니
Programming/Verilog2018. 1. 26. 16:31

정리 안해놨었나..?

왼쪽과 오른쪽이 혼용되서 쓰이는데

오른쪽은 C언어의 함수처럼, 변수(?)의 순서대로 선언하면 된다.

왼쪽은 구조체 변수 초기화 하는 느낌? 타이핑할 건 늘어나지만 순서대로 안해줘도 되니까

일장일단이 있다.(그래도 난 함수 처럼 순서대로 넣는게 편할 듯)

module dff (clk, d, q);

input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (.d(data), .q(net_1), .clk(clock));
  dff inst_2 (.clk(clock), .d(net_1), .q(q_out));
endmodule

module dff (clk, d, q);

input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (clock, data, net_1);
  dff inst_2 (clock, net_1, q_out);
endmodule


순서대로 할 경우 ,, 으로 값을 넣지 않을수 있는데 이 경우 Hi-Z 로 설정이 된다.

(net 타입이니까 Hi-Z로 된다고 써있는 듯)

example 1

module dff (clk, d, q);
input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (.d(data), .q(net_1), .clk(clock));
  dff inst_2 (.clk(clock), .d(net_1), .q(q_out));
endmodule

In the top module there are two instantiations of the 'dff' module. In both cases port connections are done by name, so the port order is insignificant. The first port is input port 'd', the second is output 'q' and the last is the clock in the 'inst_1'. In the dff module the order of ports is different than either of the two instantiations.

Example 2

module dff (clk, d, q);
input clk, d;
output q;
reg q;
always @(posedge clk) q = d;
endmodule
 
module top;
reg data, clock;
wire q_out, net_1;
  dff inst_1 (clock, data, net_1);
  dff inst_2 (clock, net_1, q_out);
endmodule

Example 3

dff inst_1 (clock, , net_1);

Second port is unconnected and has the value Z because it is of the net type.

Example 4

module my_module (a, b, c);
input a, b;
output c;
  assign c = a & b ;
endmodule
 
module top (a, b, c) ;
input [3:0] a, b;
output [3:0] c;
  my_module inst [3:0] (a, b, c);

endmodule 

[링크 : http://verilog.renerta.com/mobile/source/vrg00027.htm]

[링크 : https://en.wikibooks.org/wiki/Programmable_Logic/Verilog_Module_Structure]

'Programming > Verilog' 카테고리의 다른 글

Verilog HDL, paramter 와 module, 그리고 delay  (0) 2018.03.03
encrypted Verilog  (0) 2018.02.03
verliog module 선언  (0) 2018.01.25
verilog 모델링 유형  (0) 2018.01.20
verilog Concatenation, Replication operator  (0) 2018.01.19
Posted by 구차니
Programming/Verilog2018. 1. 25. 22:02

module에 변수(?) 선언하는 방법으로 두가지가 존재한다.

하나는 C언어 함수 처럼, 방향과 변수명을 지정해주는 것이고

다른 하나는 모듈에 사용할 핀 이름만 선언하고 방향을 지정해주는 것이다.


개인적으로는 C 스타일의 모듈 변수 선언에 방향을 넣는게 나을 것으로 보인다.


module DE0_NANO(

input CLOCK_50

);

endmodule


module DE0_NANO(

CLOCK_50

);

input           CLOCK_50;

endmodule


'Programming > Verilog' 카테고리의 다른 글

encrypted Verilog  (0) 2018.02.03
verilog module instantiate  (0) 2018.01.26
verilog 모델링 유형  (0) 2018.01.20
verilog Concatenation, Replication operator  (0) 2018.01.19
verilog unary reduction operator와 bitwise operator  (0) 2018.01.19
Posted by 구차니