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 구차니
Programming/Verilog2018. 1. 20. 14:20

베릴로그 언어적 특성에 대해서 혼동을 하고 있었네..


Gate Level Modeling

- primitives 를 이용한 게이트 레벨 설계방법

- and, or, nand, nor, xor, xnor

- buf, not

- bufif1, bufif0, notif1, notif0 (tri-state)

일종의 변수 처럼 사용하여 인스턴스를 생성, 변수들을 서로 엮어 회로 구성

module and_from_nand(X, Y, F);

input X, Y;

output F;

wire W;

// Two instantiations of the module NAND

nand U1(W, X, Y);

nand U2(F, WW);

endmodule 


Dataflow Modeling 

- assign 키워드 사용

- net에 특정 논리값을 지정함으로서 데이터의 흐름을 통해(routing?) 회로 구성

- 각종 연산자들 사용가능

아래와 같이 wire로 net 끼리 연결하거나, wire로 선언 후 assign을 통해서 연결

wire out = in1 & in2 ;


wire out;

assign out = in1 & in2 ; 


Behavioral Modeling 

- always 키워드 이용

- always 내부의 내용은 시퀀셜 하게 작동. always들 끼리는 병렬로 작동

- alwyas 는 항상 작동하므로, 절차적 언어의 무한반복문과 유사한 개념

- 절차적(always) 에서는 블러킹과 넌블러킹이 존재

(즉, dataflow나 gate level에서는 해당 개념이 존재하지 않음. 이녀석이 혼동의 원인)

- 블러킹 '=' 라인 순서대로 수행

- 넌블러킹 '<=' 넌블러킹 끼리는 동시 수행

- C언어 같은 느낌으로 if, switch-case등을 지원

- for 문은 합성툴에 따라 반복횟수 제한되거나, 지원하지 않음


블러킹과 넌블러킹으로 인해서 경쟁상태 발생이 가능함.

race condition 발생시에는 어떤 값이 있을지 알 수 없으므로 오작동 유발

- always들 끼리 같은 값에 쓰지 않도록 하며

- 써야 한다면 넌 블러킹으로 할당하면 값이 변동되지 않음

// illustration 1 : blocking

always @(posegde clk)

a = b ;

always @(posedge clk)

b = a;


// illustration 2 : nonblocking

always @(posegde clk)

a <= b ;

always @(posedge clk)

b <= a; 

자료 괜찮은거 같은데.. 이거 상위 페이지에서 한번에 받기는 못 찾음..

[링크 : https://cms3.koreatech.ac.kr/sites/yjjang/down/dsys07/01VerilogHDL.pdf]

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

verilog module instantiate  (0) 2018.01.26
verliog module 선언  (0) 2018.01.25
verilog Concatenation, Replication operator  (0) 2018.01.19
verilog unary reduction operator와 bitwise operator  (0) 2018.01.19
베릴로그 순차적 구조적  (2) 2018.01.18
Posted by 구차니
Programming/Verilog2018. 1. 19. 08:46

베릴로그 프리젠테이션 파일 보다 신기한거 발견


concatenation operator는 말그대로 합체! 하는 연산자 인데

일반적인 프로그래밍 언어라면 불가능하지만

하드웨어 배선으로는 너무나 쉬운 데이터끼리 붙이는 연산자이다.

가장 쉬운 활용예로는 Adder에서 Carry bit


r_VAL_1을 MSB 쪽으로 r_VAL_2를 LSB 쪽으로 붙여서 01111100 으로 만드는 연산자이다.

단, 부족한(?) 선은 0으로 대체 하는 듯

근데.. 이거 몇개 까지 붙일 수 있을지 궁금하네?

reg [3:0]  r_VAL_1 = 4'b0111;

reg [3:0]  r_VAL_2 = 4'b1100;

wire [7:0] w_CAT;


assign w_CAT = {r_VAL_1, r_VAL_2}; 

[링크 : https://www.nandland.com/verilog/examples/example-concatenation-operator.html]


Relication operator는 복제하는 녀석인데

비트 연산으로 이걸 하려면 참 토나오는데,

하드웨어로는 배선을 분기쳐서 이어주면 되니 간편하게 쓸 수 있겠네

문법 자체는 정규표현식 같은 느낌

앞의 숫자 만큼 순서대로 붙인다 011101110111

reg [3:0]  r_VAL_1 = 4'b0111;

{3{r_VAL_1}};


# Replication of 0x7, 3 times is 0x777

[링크 : https://www.nandland.com/verilog/examples/example-replication-operator.html]

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

verliog module 선언  (0) 2018.01.25
verilog 모델링 유형  (0) 2018.01.20
verilog unary reduction operator와 bitwise operator  (0) 2018.01.19
베릴로그 순차적 구조적  (2) 2018.01.18
structural vs behavioral verilog  (0) 2018.01.12
Posted by 구차니