Ece4750 Cheat Sheet
Ece4750 Cheat Sheet
Linux Commands
man command
pwd
echo ${ENVVAR}
echo "string"
mkdir A
make dir A to B
mkdir -p A/B
make all dirs in path A/B
ls
list contents of current working dir
ls -la
list contents of current working dir (verbose)
ls A
list contents of dir A
ls *.txt list files with .txt suffix in current working dir
tree
recusrively list contents of current working dir
cd A
change current working dir to A
cd ..
change current working dir to parent dir
cd ~
change current working dir to home dir
cp a b
cp -r A B
mv a b
mv A B
rm a
rm -r A
rmdir A
copy file a to b
copy dir A to B
move file a to b
move dir A to B
remove file a
remove dir A
remove dir A
cat a
display file a
less a
display file a with paging and search
grep "string" a
search file a for given string
grep -r "string" A
recursively search files in dir A
tar -czvf a.tgz A
create archive a.tgz of dir A
tar -xzvf a.tgz
extract archive a.tgz
cmd >
cmd
cmd_a
cmd_a
a
redirect output of cmd to newly created file a
a
redirect output of cmd to append to file a
&& cmd_b
execute cmd_a and then execute cmd_b
| cmd_b
send output from cmd_a to cmd_b
Git Commands
help cmd
display help on git command cmd
init
initialize current working dir as a git repo
add a
add file a to staging area
add A
add directory A to staging area
commit
commit staged files
commit -m "msg"
commit staged files w/ commit msg
commit -a -m "msg" commit tracked files w/ commit msg
log
show history log of previous commits
status
show status of local repo
checkout a
revert file a to last commit
checkout A
revert dir A to last commit
clone url
clone repo at given URL
pull
pull remote commits to local repository
push
push local commits to remote repository
remote -v
list remote repositories
whatchanged show incremental changes for each commit
xstatus
xlog
xadd
Setting up GitHub
git remote set-url origin \
[email protected]:<id>/<repo>.git
git push --set-upstream origin master
cd ${HOME}/ece4750/ece4750-tut3-verilog
mkdir build
cd build
../configure
make
%
%
%
%
%
%
%
%
make ex-gcd-GcdUnit-test
./ex-gcd-GcdUnit-test
./ex-gcd-GcdUnit-test +verbose=1
./ex-gcd-GcdUnit-test +test-case=1 +trace=1
./ex-gcd-GcdUnit-test +test-case=1 +dump-vcd
gtkwave ex_gcd_GcdUnit-test.vcd &
make ex-gcd-check
make check
%
%
%
%
make ex-gcd-sim
./ex-gcd-sim +input=random-a +stats
./ex-gcd-sim +input=random-b +stats
make ex-gcd-eval
ex-regincr-RegIncr.v
ex-regincr-RegIncr.t.v
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Registered Incrementer
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// ex - regincr - RegIncr Unit Tests
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
ifndef E X _ R E G I N C R _ R E G _ I N C R _ V
define E X _ R E G I N C R _ R E G _ I N C R _ V
module e x _ r e g i n c r _ R e g I n c r
(
input logic
clk ,
input logic [7:0] in ,
output logic [7:0] out
);
module top ;
VC_TEST_SUITE_BEGIN (
" ex - regincr - RegIncr " )
// Sequential logic
logic [7:0] temp_reg ;
always @ ( posedge clk )
temp_reg <= in ;
// Combinational logic
logic [7:0] temp_wire ;
always @ (*)
temp_wire = temp_reg + 1;
// Combinational logic
assign out = temp_wire + 1;
endmodule
endif /* E X _ R E G I N C R _ R E G _ I N C R _ V */
1:
2:
3:
9:
10:
11:
12:
src
0f05
#
#
#
#
#
#
>
>
>
>
>
>
>
in
A
0f:05(xx
#
(0f
#
(0a
#
(05
#
(00
#
(05
#
(05
B
xx
05
05
05
05
00
00
ST out sink
I )
>
C-)
>
C-)
>
C-)
>
Cs)
>
C )
>
D )05 > 05
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Test e x _ r e g i n c r _ R e g I n c r
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - logic [7:0] t1_in ;
logic [7:0] t1_out ;
e x _ r e g i n c r _ R e g I n c r t1_reg_incr
(
. clk ( clk ) ,
. in
( t1_in ) ,
. out ( t1_out )
);
// Helper task
task t1
(
input logic [7:0] in ,
input logic [7:0] out
);
begin
t1_in = in ;
#1;
V C _ T E S T _ N O T E _ I N P U T S _ 1 ( in );
VC_TEST_NET ( t1_out , out );
#9;
end
endtask
// Test case
V C _ T E S T _ C A S E _ B E G I N ( 1 , " basic " )
begin
#1;
t1 ( 8 ' h00 , 8 ' h ?? );
t1 ( 8 ' h13 , 8 ' h02 );
t1 ( 8 ' h27 , 8 ' h15 );
t1 ( 8 ' hxx , 8 ' h29 );
end
VC_TEST_CASE_END
VC_TEST_SUITE_END
endmodule