Skip to content

Commit 20a80f5

Browse files
authored
Merge pull request #943 from Logic-Design-Services/check-component-action
Update LICENSE to Logic Design Services.
2 parents 43b1a8d + ef7506a commit 20a80f5

File tree

312 files changed

+3492
-2463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+3492
-2463
lines changed

LICENSE

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

2-
CTU CAN FD IP Core
3-
Copyright (C) 2021-present Ondrej Ille
2+
CTU CAN FD IP Core
3+
Copyright (C) 2021-2023 Ondrej Ille
4+
Copyright (C) 2023- Logic Design Services Ltd.s
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this VHDL component and associated documentation files (the "Component"),
78
to use, copy, modify, merge, publish, distribute the Component for
8-
educational, research, evaluation, self-interest purposes. Using the
9-
Component for commercial purposes is forbidden unless previously agreed with
10-
Copyright holder.
9+
non-commercial purposes. Using the Component for commercial purposes is
10+
forbidden unless previously agreed with Copyright holder.
1111

1212
The above copyright notice and this permission notice shall be included in
1313
all copies or substantial portions of the Component.
@@ -26,14 +26,14 @@ protocol license from Bosch.
2626

2727
-------------------------------------------------------------------------------
2828

29-
CTU CAN FD IP Core
29+
CTU CAN FD IP Core
3030
Copyright (C) 2015-2020 MIT License
3131

3232
Authors:
3333
Ondrej Ille <[email protected]>
3434
Martin Jerabek <[email protected]>
3535

36-
Project advisors:
36+
Project advisors:
3737
Jiri Novak <[email protected]>
3838
Pavel Pisa <[email protected]>
3939

scripts/license_updater.py

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
################################################################################
2-
##
3-
## CAN with Flexible Data-Rate IP Core
4-
##
1+
################################################################################
2+
##
3+
## CAN with Flexible Data-Rate IP Core
4+
##
55
## Copyright (C) 2017 Ondrej Ille <[email protected]>
6-
##
6+
##
77
## Script for updating license in the header source codes of CAN FD IP Core.
88
## Supports following file extensions: ".vhd" , ".tcl" , ".h" , ".c", ".cpp"
9-
##
9+
##
1010
## Arguments:
1111
## lic_path - File with license which should be placed to header of the
1212
## all source code files.
13-
## sup_files - Supported file endings which should have the license
13+
## sup_files - Supported file endings which should have the license
1414
## updated.
1515
## subfolders - Which sub-folders should be updated
1616
##
1717
## Example of usage from IDLE shell
18-
## python ./license_updater.py 'myPrettyLicense.txt' ['.c','.vhd']
18+
## python ./license_updater.py 'myPrettyLicense.txt' ['.c','.vhd']
1919
## ['src','test']
2020
##
2121
## Revision history:
@@ -71,14 +71,14 @@ def print_help():
7171

7272

7373
def write_license(lic_text, comment_char, file):
74-
74+
7575
line_length = 80
76-
76+
7777
# Write the initial line (TCL, VHDL)
7878
if (comment_char == "-" or comment_char == "#"):
7979
for i in range(0, line_length):
8080
file.write(comment_char)
81-
81+
8282
# Write the initial line (C)
8383
elif (comment_char == "*"):
8484

@@ -91,10 +91,10 @@ def write_license(lic_text, comment_char, file):
9191
file.write(comment_char)
9292
else:
9393
print("Unsuported Comment character")
94-
94+
9595
file.write("\n")
96-
97-
# Write rest of the lines
96+
97+
# Write rest of the lines
9898
buf = io.StringIO(lic_text)
9999
i = 0
100100
while True:
@@ -104,18 +104,20 @@ def write_license(lic_text, comment_char, file):
104104
lic_line = buf.readline()
105105
if (not(str.find("<licend1234>", lic_line) == -1)):
106106
break
107-
107+
108108
# Write Begining of the line
109109
if (comment_char == "-" or comment_char == "#"):
110-
file.write(comment_char + comment_char + " ")
110+
file.write(comment_char + comment_char)
111+
if (len(lic_line.strip()) > 0):
112+
file.write(" ")
111113
elif (comment_char == "*"):
112114
file.write(" " + comment_char)
113115
if (len(lic_line.strip()) > 0):
114-
file.write(" ")
115-
116+
file.write(" ")
117+
116118
# Write Rest of the line
117119
file.write(lic_line)
118-
120+
119121
# Write the final line
120122
if (comment_char == "-" or comment_char == "#"):
121123
for i in range(0, line_length):
@@ -128,10 +130,10 @@ def write_license(lic_text, comment_char, file):
128130
file.write(comment_char)
129131
else:
130132
for i in range(0, line_length-1):
131-
file.write(comment_char)
133+
file.write(comment_char)
132134

133135
file.write("/")
134-
136+
135137
file.write("\n")
136138

137139

@@ -141,78 +143,78 @@ def write_license(lic_text, comment_char, file):
141143
def write_source(source_file, dest_file, comment_sign):
142144
## Read the first file line because this is always commented
143145
source_file.readline()
144-
146+
145147
## Read the license lines
146148
## First or second line of the source code is
147149
## the "comment character"
148150
line = source_file.readline()
149-
while (line.startswith(comment_sign) or line[1]==comment_sign):
151+
while (line.startswith(comment_sign) or line[1]==comment_sign):
150152
line = source_file.readline()
151153
if (len(line)==1):
152154
break
153-
155+
154156
dest_file.write("\n")
155-
157+
156158
## Now read rest of the source code and copy to dest
157159
while True:
158160
char = source_file.read()
159161
if (char == ""):
160162
break
161163
dest_file.write(char)
162-
163-
164-
165-
164+
165+
166+
167+
166168

167169
################################################################################
168170
## Process the file and change the license header, if the file type is in the
169171
## list of supported file extensions.
170172
################################################################################
171173
def process_file(filename):
172-
174+
173175
global sup_files
174176
file_ext_match = False
175177
ext_type = ""
176178
comment_sign = ""
177-
179+
178180
for ext in sup_files:
179181
if (filename.endswith(ext)):
180182
file_ext_match = True
181183
ext_type = ext
182-
184+
183185
if (file_ext_match == False):
184186
return
185-
187+
186188
print("Processing file: " + filename)
187-
189+
188190
## Check the comment sign based on file type
189191
if ((ext_type == ".c") or (ext_type == ".cpp")):
190192
comment_sign = "*"
191-
elif (ext_type == ".h"):
193+
elif (ext_type == ".h"):
192194
comment_sign = "*"
193-
elif (ext_type == ".tcl"):
195+
elif (ext_type == ".tcl"):
194196
comment_sign = "#"
195-
elif (ext_type == ".vhd"):
197+
elif (ext_type == ".vhd"):
196198
comment_sign = "-"
197199
else:
198200
comment_sign = "-"
199201

200202
## Read the file content
201203
file = open (filename,"r")
202204
temp_file = open ("temp.txt","wt")
203-
205+
204206
## Write the new license to the temp file
205207
write_license(lic_text, comment_sign, temp_file)
206-
208+
207209
## Write rest of the file after license update
208210
write_source(file, temp_file, comment_sign)
209211
temp_file.close()
210212
file.close()
211-
213+
212214
## Replace the original file and erase the temp file
213215
os.remove(filename)
214216
os.rename("temp.txt", filename)
215-
217+
216218

217219
################################################################################
218220
## Parse the command line arguments and fill according global variables
@@ -223,9 +225,9 @@ def parse_args():
223225
global sub_folders
224226
global lic_path
225227
global src_path
226-
227-
src_path=os.path.dirname(os.path.abspath(__file__))
228-
228+
229+
src_path=os.path.dirname(os.path.abspath(__file__))
230+
229231
lic_path = sys.argv[1]
230232
sup_files = sys.argv[2]
231233
sup_files = sup_files.replace("[","")
@@ -242,9 +244,9 @@ def parse_args():
242244
def load_license(lic_path):
243245
global lic_text
244246
global src_path
245-
246-
src_path=os.path.dirname(os.path.abspath(__file__))
247-
247+
248+
src_path=os.path.dirname(os.path.abspath(__file__))
249+
248250
lic_full_path=os.path.join(src_path, lic_path)
249251
print(lic_full_path)
250252
if (os.path.isfile(lic_full_path)):
@@ -267,54 +269,54 @@ def load_license(lic_path):
267269
def iterate_dir(dir_path):
268270

269271
print ("Processing directory: "+dir_path)
270-
272+
271273
## Process files and directories in this directory
272274
sub_dirs = os.listdir(dir_path)
273275
for fold in sub_dirs:
274276
full_dir = os.path.join(dir_path, fold)
275-
277+
276278
## Execute recursively on directories
277279
if (os.path.isdir(full_dir)):
278280
iterate_dir(full_dir)
279-
281+
280282
## Process the files
281283
if (os.path.isfile(full_dir)):
282284
process_file(full_dir)
283-
285+
284286

285287
################################################################################
286288
## Main function which executes the license replacement
287289
################################################################################
288290
def main():
289-
291+
290292
global sup_files
291293
global sub_folders
292294
global lic_text
293295
global lic_path
294296
global src_path
295297
print ("")
296-
298+
297299
## Check valid input arguments
298-
arg_count = 4 ## 3 arguments + script itself
300+
arg_count = 4 ## 3 arguments + script itself
299301
if (len(sys.argv) != arg_count):
300302
print(" Incorrect amount of arguments!")
301303
print_help()
302304
print(" Exiting!")
303305
sys.exit(1)
304-
306+
305307
## Parse Command line arguments
306308
parse_args()
307-
309+
308310
## Check license existance and load it
309311
load_license(lic_path)
310-
312+
311313
#Check file extensions
312314
for ext in sup_files:
313315
if (not ext.startswith(".")):
314316
print ("Invalid file extension '"+ext+"' File extenstions should "\
315317
"start with '.'")
316318
sys.exit(1)
317-
319+
318320
#Replace the license in the subfolders
319321
for dir in sub_folders:
320322
dir_path=os.path.join(src_path,'..')
@@ -323,6 +325,6 @@ def main():
323325
iterate_dir(dir_path)
324326
else:
325327
print(dir_path+" directory does not exist")
326-
328+
327329
if __name__ == "__main__":
328330
main()

scripts/update_reg_map

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ d="$(dirname "$0")"
44

55
# Note: the script uses relative paths and must be called from this directory
66
cd "$d"
7+
8+
echo "********************************************************************************"
9+
echo "Generate register map"
10+
echo "********************************************************************************"
11+
712
python3 update_reg_map.py --xactSpec ../spec/CTU/ip/CAN_FD_IP_Core/2.1/CAN_FD_IP_Core.2.1.xml \
813
--updVHDLPackage True \
914
--updHeaderFile True \
1015
--updLyxDocs True \
1116
--updRTLRegMap True \
1217
--updTbPackage True
18+
19+
echo "********************************************************************************"
20+
echo "Replace license in the generated RTL register map:"
21+
echo "********************************************************************************"
22+
23+
python3 license_updater.py ../LICENSE ['.vhd'] ['src/memory_registers/generated']

src/bus_sampling/bit_err_detector.vhd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
--------------------------------------------------------------------------------
22
--
33
-- CTU CAN FD IP Core
4-
-- Copyright (C) 2021-present Ondrej Ille
4+
-- Copyright (C) 2021-2023 Ondrej Ille
5+
-- Copyright (C) 2023- Logic Design Services Ltd.s
56
--
67
-- Permission is hereby granted, free of charge, to any person obtaining a copy
78
-- of this VHDL component and associated documentation files (the "Component"),
89
-- to use, copy, modify, merge, publish, distribute the Component for
9-
-- educational, research, evaluation, self-interest purposes. Using the
10-
-- Component for commercial purposes is forbidden unless previously agreed with
11-
-- Copyright holder.
10+
-- non-commercial purposes. Using the Component for commercial purposes is
11+
-- forbidden unless previously agreed with Copyright holder.
1212
--
1313
-- The above copyright notice and this permission notice shall be included in
1414
-- all copies or substantial portions of the Component.

src/bus_sampling/bus_sampling.vhd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
--------------------------------------------------------------------------------
22
--
33
-- CTU CAN FD IP Core
4-
-- Copyright (C) 2021-present Ondrej Ille
4+
-- Copyright (C) 2021-2023 Ondrej Ille
5+
-- Copyright (C) 2023- Logic Design Services Ltd.s
56
--
67
-- Permission is hereby granted, free of charge, to any person obtaining a copy
78
-- of this VHDL component and associated documentation files (the "Component"),
89
-- to use, copy, modify, merge, publish, distribute the Component for
9-
-- educational, research, evaluation, self-interest purposes. Using the
10-
-- Component for commercial purposes is forbidden unless previously agreed with
11-
-- Copyright holder.
10+
-- non-commercial purposes. Using the Component for commercial purposes is
11+
-- forbidden unless previously agreed with Copyright holder.
1212
--
1313
-- The above copyright notice and this permission notice shall be included in
1414
-- all copies or substantial portions of the Component.

0 commit comments

Comments
 (0)