Beispiel #1
0
def __init__():
    components.register(
            'kolabd',
            execute,
            description=description(),
            after=['ldap','imap']
        )
Beispiel #2
0
def __init__():
    components.register(
            'freebusy',
            execute,
            description=description(),
            after=['ldap']
        )
Beispiel #3
0
 def place(self, roomid, thingid):
   room = data.rooms.get(roomid)
   thing = data.datatypes.get(thingid)
   inst = instance(thingid)
   register(inst)
   room['contents'].append(inst['uuid'])
   inst['located'] = room['id']
   return inst
Beispiel #4
0
 def __init__(self):
   load(os.sep.join(['./edit']))
   for k in data.datatypes:
       e = data.datatypes[k]
       if e.get("room"):
           if not e.get("base"):
               register(instance(e.get("id")))    
   for k in data.rooms:
       act("init", data.rooms[k])
   self.report_data()
Beispiel #5
0
def contents(d):
  #we need a new list, as d is a reference
  res = []
  for e in d:
    if e.get("id"):
      c_e = components.construct(e)
      new = components.instance(e.get("id"))
      #we merge the conent entry onto the instance
      merged = dict(new.items() + c_e.items())
      components.register(merged)
      res.append(merged.get("uuid"))
  return res
Beispiel #6
0
# tell browser to expect HTML
print("Content-Type: text/html\n")

# get any data sent with the GET or POST request
# this may be required by multiple components
sent_data = cgi.FieldStorage()

# -------- START OF FUNCTIONAL COMPONENTS ----------->>>

# ---------- HANDLE REGISTRATION FORM SUBMISSIONS ----------

# check if login form was submitted
if 'btn_register' in sent_data:
    # it was, so call the login function
    result = components.register(db, sent_data)
    msg = result['msg']
else:
    # message displayed in register form will be empty
    msg = ""

#render html document containing form
print(utils.render_html(config['HTML'] + 'register.html', data=[msg]))

# ---------- HANDLE REGISTRATION FORM SUBMISSIONS ERRORS -----------

# check if registered already
if 'btn_register' in sent_data:
    # student is already registered?
    result = components.register(db, sent_data['registered'].value=True)
    msg = "Student is already registered."
Beispiel #7
0
    def make_str(self, width, log2width):
        widthp1 = width + 1
        string = '''\
/****************************************************************************
          Shifter unit

Opcode Table:

sign_ext dir 
 0        0    |  ShiftLeft
 0        1    |  ShiftRightLogic
 1        1    |  ShiftRightArith
          
****************************************************************************/
module vlane_barrelshifter_{WIDTH}_{LOG2WIDTH}(clk, resetn,
            opB, sa, 
            op, 
            result);
//parameter {WIDTH}=32;
//parameter {LOG2WIDTH}=5;

//Shifts the first 2 bits in one cycle, the rest in the next cycle
//parameter ({LOG2WIDTH}-2)={LOG2WIDTH}-2;

input clk;
input resetn;

input [{WIDTH}-1:0] opB;
input [{LOG2WIDTH}-1:0] sa;                             // Shift Amount
input [2-1:0] op;

output [{WIDTH}-1:0] result;


wire sign_ext;
wire shift_direction;
assign sign_ext=op[1];
assign shift_direction=op[0];

wire dum,dum_,dum2;
wire [{WIDTH}-1:0] partial_result_,partial_result;
`ifndef USE_INHOUSE_LOGIC
    `define USE_INHOUSE_LOGIC
`endif

`ifdef USE_INHOUSE_LOGIC
wire [{WIDTHP1}-1:0] local_shifter_inst1_result;
assign {CBS}dum,partial_result{CBE} = local_shifter_inst1_result;

wire [2-1:0] local_shifter_inst1_distance;
assign local_shifter_inst1_distance = sa&(32'hffffffff<<((({LOG2WIDTH}-2)>0) ? ({LOG2WIDTH}-2) : 0));

wire [{WIDTHP1}-1:0] local_shifter_inst1_data;
assign local_shifter_inst1_data = {CBS}sign_ext&opB[{WIDTH}-1],opB{CBE};

local_shifter_{WIDTHP1}_2_ARITHMATIC local_shifter_inst1(
  .data(local_shifter_inst1_data),
  .distance(local_shifter_inst1_distance),
  .direction(shift_direction),
  .result(local_shifter_inst1_result)
);
 //defparam
 //   local_shifter_inst1.LPM_WIDTH = {WIDTH}+1,
 //   local_shifter_inst1.LPM_WIDTHDIST = {LOG2WIDTH},
 //   local_shifter_inst1.LPM_SHIFTTYPE="ARITHMETIC";
`else
lpm_clshift shifter_inst1(
    .data({CBS}sign_ext&opB[{WIDTH}-1],opB{CBE}),
    .distance(sa&(32'hffffffff<<((({LOG2WIDTH}-2)>0) ? ({LOG2WIDTH}-2) : 0))),
    .direction(shift_direction),
    .result(dum,partial_result));
 defparam
    shifter_inst1.lpm_width = {WIDTH}+1,
    shifter_inst1.lpm_widthdist = {LOG2WIDTH},
    shifter_inst1.lpm_shifttype="ARITHMETIC";
`endif

wire [{WIDTHP1}-1:0] partial_reg_q;
assign partial_reg_q = {CBS}dum_,partial_result_{CBE};
register_{WIDTHP1} partial_reg
  ({CBS}dum,partial_result{CBE},clk,resetn,1'b1,partial_reg_q);

wire [5-1:0] sa_2;
wire shift_direction_2;

register_5 secondstage (sa, clk,resetn,1'b1,sa_2); 

register_1 secondstagedir (shift_direction, clk,resetn,1'b1,shift_direction_2); 

`ifdef USE_INHOUSE_LOGIC
wire [{WIDTHP1}-1:0] local_shifter_inst2_result;
assign {CBS}dum2,result{CBE} = local_shifter_inst2_result;

wire [2-1:0] local_shifter_inst2_distance;
assign local_shifter_inst2_distance = sa_2[({LOG2WIDTH}-2)-1:0];

wire [{WIDTHP1}-1:0] local_shifter_inst2_data;
assign local_shifter_inst2_data = {CBS}dum_,partial_result_{CBE};

local_shifter_{WIDTHP1}_2_ARITHMATIC local_shifter_inst2(
  .data(local_shifter_inst2_data),
  .distance(local_shifter_inst2_distance),
  .direction(shift_direction_2),
  .result(local_shifter_inst2_result)
);
// defparam
//    local_shifter_inst2.LPM_WIDTH = {WIDTH}+1,
//   local_shifter_inst2.LPM_WIDTHDIST = (({LOG2WIDTH}-2)>0) ? ({LOG2WIDTH}-2) : 1,
//    local_shifter_inst2.LPM_SHIFTTYPE ="ARITHMETIC";
`else
lpm_clshift_{WIDTHP1}_2_ARITHMATIC shifter_inst2(
    .data({CBS}dum_,partial_result_{CBE}),
    .distance(sa_2[((({LOG2WIDTH}-2)>0) ? ({LOG2WIDTH}-2)-1 : 0):0]),
    .direction(shift_direction_2),
    .result({CBS}dum2,resulti{CBE}));
 defparam 
    shifter_inst2.lpm_width = {WIDTH}+1,
    shifter_inst2.lpm_widthdist = (({LOG2WIDTH}-2)>0) ? ({LOG2WIDTH}-2) : 1,
    shifter_inst2.lpm_shifttype="ARITHMETIC";
`endif


endmodule

        '''
        fp = open("verilog/local_shifter.v", 'a')
        uut = local_shifter(fp)
        uut.write(widthp1, 2, "ARITHMATIC")
        fp.close()
        fp = open("verilog/components.v", 'a')
        uut = register(fp)
        uut.write(widthp1)
        fp.write("\n")
        fp.close()
        fp = open("verilog/components.v", 'a')
        uut = register(fp)
        uut.write(5)
        fp.write("\n")
        fp.close()
        fp = open("verilog/components.v", 'a')
        uut = register(fp)
        uut.write(1)
        fp.write("\n")
        fp.close()
        #
        # fp = open("verilog/pipe.v",'a')
        # uut = pipe(fp)
        # uut.write(widthp1)
        # uut.write(5)
        #  uut.write(1)
        return string.format(WIDTH=width,
                             LOG2WIDTH=log2width,
                             WIDTHP1=widthp1,
                             CBS="{",
                             CBE="}")
Beispiel #8
0
import logging

from telegram.ext import Updater

import config
from components import register

logging.basicConfig(
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    level=logging.INFO)

updater = Updater(token=config.bot_token)

register(updater.dispatcher)

updater.start_polling(config.polling_interval)

updater.idle()
Beispiel #9
0
            d_loadresult[31:16]={{16{{load_sign_ext&d_loadresult[15]}}}};
        end
        default:
            d_loadresult=d_readdatain;
    endcase
end

endmodule'''

        return string.format(WIDTH=width)

    def write(self, width):
        self.fp.write(self.make_str(width))


if __name__ == '__main__':
    fp = open(parser.parse(), "w")
    uut = data_mem(fp)
    uut.write(32, 32, 4, 16, 16384)
    fp.close()
    fp = open(parser.parse(), "a")
    fp.write("\r\r")
    store = store_data_translator(fp)
    store.write(32)
    fp.write("\r\r")
    load = load_data_translator(fp)
    load.write(32)
    fp.write("\r\r")
    reg = register(fp)
    reg.write(2)
    fp.close()
Beispiel #10
0
def __init__():
    components.register('kolabd',
                        execute,
                        description=description(),
                        after=['ldap', 'imap'])
Beispiel #11
0
def __init__():
    components.register('php', execute, description=description())
Beispiel #12
0
def __init__():
    components.register('roundcube', execute, description=description(), after=['mysql','ldap'])
Beispiel #13
0
                             I_SIZE=i_size)

    def write(self, exception_address, i_datawidth, i_addresswidth, i_size):
        self.fp.write(
            self.make_str(exception_address, i_datawidth, i_addresswidth,
                          i_size))


if __name__ == '__main__':
    fp = open(parser.parse(), "w")
    uut = ifetch(fp)
    uut.write(67108896, 32, 14, 16384)
    fp.close()
    fp = open(parser.parse(), "a")
    fp.write("\r\r")
    reg1 = register(fp)
    reg1.write(32)
    fp.write("\r\r")
    reg2 = register(fp)
    reg2.write(2)
    fp.write("\r\r")
    br_detect = branch_detector(fp)
    br_detect.write()
    fp.write("\r\r")
    pipereg = pipereg(fp)
    pipereg.write(1)
    fp.write("\r\r")
    br_pred = branchpredict(fp)
    br_pred.write(32, 4096, 12, 1)
    fp.write("\r\r")
    ram = dpram(fp)
Beispiel #14
0
def __init__():
    components.register('manticore',
                        execute,
                        description=description(),
                        after=['ldap', 'roundcube'])
Beispiel #15
0
def __init__():
    components.register('mta',
                        execute,
                        description=description(),
                        after=['ldap'])
Beispiel #16
0
def __init__():
    components.register('php', execute, description=description())
#!/usr/bin/env python3

# import modules from Python standard library
import cgi
import cgitb
cgitb.enable()

# import custom modules
from config import config
import utils
import components

# connect to database
db = utils.db_connect(config)

# tell the browser we are outputting HTML
print("Content-Type: text/html\n")

# get the form data
form = cgi.FieldStorage()

# check that register form was submitted
if 'btn_register' in form:
    result = components.register(db, form)
    msg = result['msg']
else:
    msg = ""

# output the form as HTML
print(utils.render_html(config['HTML'] + 'register.html', data=[msg]))
Beispiel #18
0
def __init__():
    components.register('syncroton', execute, description=description(), after=['mysql','ldap','roundcube'])
Beispiel #19
0
def recursive_register(e):
  cont = e.get("contents")
  if cont:
    e["contents"] = map(recursive_register, cont)
  register(e)
  return e.get("uuid")