OpenCores
URL https://opencores.org/ocsvn/nocmodel/nocmodel/trunk

Subversion Repositories nocmodel

[/] [nocmodel/] [trunk/] [nocmodel/] [basicmodels/] [basic_protocol.py] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dargor
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
 
4
#
5
# Basic Protocol model
6
#
7
# Author:  Oscar Diaz
8
# Version: 0.1
9
# Date:    03-03-2011
10
 
11
#
12
# This code is free software; you can redistribute it and/or
13
# modify it under the terms of the GNU Lesser General Public
14
# License as published by the Free Software Foundation; either
15
# version 2.1 of the License, or (at your option) any later version.
16
#
17
# This code is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
# Lesser General Public License for more details.
21
#
22
# You should have received a copy of the GNU Lesser General Public
23
# License along with this library; if not, write to the
24
# Free Software  Foundation, Inc., 59 Temple Place, Suite 330,
25
# Boston, MA  02111-1307  USA
26
#
27
 
28
#
29
# Changelog:
30
#
31
# 03-03-2011 : (OD) initial release
32
#
33
 
34
"""
35
Basic protocol helper
36
"""
37
 
38
from nocmodel.noc_base import *
39
 
40
class basic_protocol(protocol):
41
    """
42
    Basic protocol class
43
 
44
    This class simplify protocol object creation. It defines a simple packet
45
    with the following fields:
46
 
47
    |0   7|8  15|16  31|
48
    | src | dst | data |
49
    """
50
    def __init__(self):
51
        protocol.__init__(self, name="Basic protocol")
52
        self.update_packet_field("src", "int", 8, "Source address")
53
        self.update_packet_field("dst", "int", 8, "Destination address")
54
        self.update_packet_field("data", "int", 16, "Data payload")

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.